summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-04-20 06:46:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-04-20 06:46:12 -0700
commit257c53a6f0aa7b1926376c8e0fbcaec4b6c7a295 (patch)
treea21e786130e321ac31ab76328e6e89601bc5f303 /share
parentca6020cff56c12958b6be1e75fa5fde29557649a (diff)
downloadtxr-257c53a6f0aa7b1926376c8e0fbcaec4b6c7a295.tar.gz
txr-257c53a6f0aa7b1926376c8e0fbcaec4b6c7a295.tar.bz2
txr-257c53a6f0aa7b1926376c8e0fbcaec4b6c7a295.zip
compiler: avoid wasteful substitution via %bin-op%.
* share/txr/stdlib/compiler.tl (%bin-op%): Specify default value argument to relate so that arguments not found in %nary-ops% will match to nil. Otherwise the code in comp-fun-form rewrites all two-argument function calls through this relation, resulting in a bit of wasted consing.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/compiler.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index 5c397a4a..cd5f3150 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -193,7 +193,7 @@
(defvarl %bin-ops% '(b< b> b<= b=> b= b+ b- b* b/))
-(defvarl %bin-op% (relate %nary-ops% %bin-ops%))
+(defvarl %bin-op% (relate %nary-ops% %bin-ops% nil))
(defvarl assumed-fun)