aboutsummaryrefslogtreecommitdiff
path: root/src/interp/c-util.boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp/c-util.boot')
-rw-r--r--src/interp/c-util.boot11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 0f85c636..0b62a0f8 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -42,6 +42,8 @@ module c_-util where
foldExportedFunctionReferences: %List -> %List
diagnoseUnknownType: (%Mode,%Env) -> %Form
declareUnusedParameters: (%List,%Code) -> %List
+ registerFunctionReplacement: (%Symbol,%Form) -> %Thing
+ getFunctionReplacement: %Symbol -> %Form
--%
@@ -86,6 +88,11 @@ $optExportedFunctionReference := false
--%
+++ Quote form, if not a basic value.
+quoteMinimally form ==
+ FIXP form or STRINGP form or form = nil or form = true => form
+ ["QUOTE",form]
+
++ If using old `Rep' definition semantics, return `$' when m is `Rep'.
++ Otherwise, return `m'.
dollarIfRepHack m ==
@@ -1035,6 +1042,10 @@ getFunctionReplacement name ==
clearReplacement name ==
REMPROP(name,"SPADreplace")
+++ Register the inlinable form of a function.
+registerFunctionReplacement(name,body) ==
+ LAM_,EVALANDFILEACTQ ["PUT",MKQ name,MKQ "SPADreplace",quoteMinimally body]
+
eqSubstAndCopy: (%List, %List, %Form) -> %Form
eqSubstAndCopy(args,parms,body) ==
SUBLIS(pairList(parms,args),body,KEYWORD::TEST,function EQ)