diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/interp/compiler.boot | 14 | ||||
-rw-r--r-- | src/interp/macros.lisp | 11 | ||||
-rw-r--r-- | src/interp/sys-utility.boot | 20 |
4 files changed, 32 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9f61d8ee..0677c26b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,6 +2,12 @@ * interp/compiler.boot (compExpression): Tidy. (coerceExtraHard): Convert domain instantiations to domain objects. + (compAndDefine): Capture by name, not pointer. + (compQuietly): Likewise. + (compileQuietly): Likewise. + * interp/macros.lisp (PRINT-AND-EVAL-DEFUN): Move to sys-utility.boot. + (EVAL-DEFUN): Likewise. + (COMPILE-DEFUN): Likewise. 2008-06-14 Gabriel Dos Reis <gdr@cs.tamu.edu> diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 35efe36a..2204a0f7 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1618,15 +1618,15 @@ compileFileQuietly path == COMPILE_-FILE path compAndDefine l == - _*COMP370_-APPLY_* := function PRINT_-AND_-EVAL_-DEFUN + _*COMP370_-APPLY_* := "PRINT-AND-EVAL-DEFUN" COMP l compQuietly fn == _*COMP370_-APPLY_* := $InteractiveMode => - $compileDontDefineFunctions => function COMPILE_-DEFUN - function EVAL_-DEFUN - function PRINT_-DEFUN + $compileDontDefineFunctions => "COMPILE-DEFUN" + "EVAL-DEFUN" + "PRINT-DEFUN" -- create a null outputstream if $InteractiveMode $OutputStream := $InteractiveMode => MAKE_-BROADCAST_-STREAM() @@ -1636,9 +1636,9 @@ compQuietly fn == compileQuietly fn == _*COMP370_-APPLY_* := $InteractiveMode => - $compileDontDefineFunctions => function COMPILE_-DEFUN - function EVAL_-DEFUN - function PRINT_-DEFUN + $compileDontDefineFunctions => "COMPILE-DEFUN" + "EVAL-DEFUN" + "PRINT-DEFUN" $OutputStream := $InteractiveMode => MAKE_-BROADCAST_-STREAM() MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*" diff --git a/src/interp/macros.lisp b/src/interp/macros.lisp index a55884b6..04cc575f 100644 --- a/src/interp/macros.lisp +++ b/src/interp/macros.lisp @@ -536,14 +536,6 @@ terminals and empty or at-end files. In Common Lisp, we must assume record size (defun DROPTRAILINGBLANKS (LINE) (string-right-trim " " LINE)) -(defun print-and-eval-defun (name body) - (eval body) - (print-defun name body) - ;; (set name (symbol-function name)) ;; this should go away - ) - -(defun eval-defun (name body) (eval (macroexpandall body))) - ; This function was modified by Greg Vanuxem on March 31, 2005 ; to handle the special case of #'(lambda ..... which expands ; into (function (lambda ..... @@ -591,9 +583,6 @@ terminals and empty or at-end files. In Common Lisp, we must assume record size (mapcar #'macroexpandall sexpr)))) -(defun compile-defun (name body) (eval body) (compile name)) - - (defun |deleteWOC| (item list) (delete item list :test #'equal)) ;;---- Added by WFS. diff --git a/src/interp/sys-utility.boot b/src/interp/sys-utility.boot index cff7ff0f..82fb11e2 100644 --- a/src/interp/sys-utility.boot +++ b/src/interp/sys-utility.boot @@ -190,7 +190,7 @@ loadModule(path,name) == FMAKUNBOUND name LOAD path ---% numericis +--% numerics log10 x == LOG(x,10) @@ -202,3 +202,21 @@ bitior: (%Short,%Short) -> %Short bitior(x,y) == BOOLE(BOOLE_-IOR,x,y) + +--% Back ends + +++ compile a function definition, augmenting the current +++ evaluation environement with the result of the compilation. +COMPILE_-DEFUN(name,body) == + EVAL body + COMPILE name + +++ Augment the current evaluation environment with a function definition. +EVAL_-DEFUN(name,body) == + EVAL MACROEXPANDALL body + +PRINT_-AND_-EVAL_-DEFUN(name,body) == + EVAL body + PRINT_-DEFUN(name,body) + + |