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.boot42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 3af79992..170f16f8 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1276,3 +1276,45 @@ transformToBackendCode x ==
RPLACD(lastdecl, body)
RPLACD(lastdecl, [declareGlobalVariables fluids,:body])
x
+
+backendCompile1 x ==
+ fname := first x
+ $FUNNAME: local := fname
+ $FUNNAME__TAIL: local := [fname]
+ lamex := second x
+ $CLOSEDFNS: local := []
+ lamex := transformToBackendCode lamex
+ backendCompileNEWNAM lamex
+ -- Note that category constructors are evaluated before they
+ -- their compiled, so this noise is not very helpful.
+ if $verbose and FBOUNDP fname then
+ FORMAT(true,'"~&~%;;; *** ~S REDEFINED~%",fname)
+ [[fname,lamex],:$CLOSEDFNS]
+
+backendCompile l ==
+ MAPCAR(function backendCompile2, MAPCAN(function backendCompile1,l))
+
+compileFileQuietly path ==
+ quietlyIfInteractive COMPILE_-FILE path
+
+compAndDefine l ==
+ _*COMP370_-APPLY_* := "PRINT-AND-EVAL-DEFUN"
+ backendCompile l
+
+compQuietly fn ==
+ _*COMP370_-APPLY_* :=
+ $InteractiveMode =>
+ $compileDontDefineFunctions => "COMPILE-DEFUN"
+ "EVAL-DEFUN"
+ "PRINT-DEFUN"
+ quietlyIfInteractive backendCompile fn
+
+compileQuietly fn ==
+ _*COMP370_-APPLY_* :=
+ $InteractiveMode =>
+ $compileDontDefineFunctions => "COMPILE-DEFUN"
+ "EVAL-DEFUN"
+ "PRINT-DEFUN"
+ quietlyIfInteractive COMP370 fn
+
+