From 5dc6f379ce7c149a6f875ed69158db2b303285bc Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 20 Apr 2020 06:46:12 -0700 Subject: 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. --- share/txr/stdlib/compiler.tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3