aboutsummaryrefslogtreecommitdiff
path: root/src/interp/define.boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp/define.boot')
-rw-r--r--src/interp/define.boot9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/interp/define.boot b/src/interp/define.boot
index d25302e8..5a8930ee 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -1246,17 +1246,16 @@ spadCompileOrSetq (form is [nam,[lam,vl,body]]) ==
if $optReplaceSimpleFunctions then
body := replaceSimpleFunctions body
- if vl is [:vl',E] and body is [nam',: =vl'] then
+ if nam' := forwardingCall?(vl,body) then
registerFunctionReplacement(nam,nam')
sayBrightly ['" ",:bright nam,'"is replaced by",:bright nam']
- else if (isAtomicForm body or and/[isAtomicForm x for x in body])
- and vl is [:vl',E] and not CONTAINED(E,body) then
- macform := ['XLAM,vl',body]
+ else if macform := expandableDefinition?(vl,body) then
registerFunctionReplacement(nam,macform)
sayBrightly ['" ",:bright nam,'"is replaced by",:bright body]
form :=
- getFunctionReplacement nam => [nam,[lam,vl,["DECLARE",["IGNORE",E]],body]]
+ getFunctionReplacement nam =>
+ [nam,[lam,vl,["DECLARE",["IGNORE",last vl]],body]]
[nam,[lam,vl,body]]
$insideCapsuleFunctionIfTrue =>