diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 18 | ||||
-rw-r--r-- | src/interp/Makefile.in | 2 | ||||
-rw-r--r-- | src/interp/c-util.boot | 7 | ||||
-rw-r--r-- | src/interp/lisp-backend.boot | 22 | ||||
-rw-r--r-- | src/interp/macros.lisp | 2 | ||||
-rw-r--r-- | src/interp/slam.boot | 2 | ||||
-rw-r--r-- | src/interp/spad.lisp | 4 | ||||
-rw-r--r-- | src/interp/sys-utility.boot | 2 | ||||
-rw-r--r-- | src/interp/vmlisp.lisp | 12 |
9 files changed, 57 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e51099df..f5a73b14 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,23 @@ 2012-05-20 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/vmlisp.lisp (EVALANDFILEACTQ): Second argument is no + longer optional. Adjust callers. + (LAM\,EVALANDFILEACTQ): Likewise. + * interp/slam.boot (compQuietly): Use printBackendDecl. + * interp/spad.lisp (SPAD): Likewise. + * interp/sys-utility.boot (PRINT-AND-EVAL-DEFUN): Likewise. + * interp/macros.lisp (SETANDFILE): Move to vmlisp.lisp. + * interp/lisp-backend.boot (printBackendStmt): New. + (evalAndPrintBackendStmt): Likewise. + (printBackendDecl): Likewise. + * interp/c-util.boot (registerFunctionReplacement): Use + evalAndPrintBackendStmt. + (registerRedexForm): Likewise. + (proclaimCapsuleFunction): Use printBackendStmt. + * interp/Makefile.in (lisp-backend.$(FASLEXT)): Require nlib.$(FASLEXT) + +2012-05-20 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/parsing.lisp (CONVERSATION): Remove. (CONVERSATION1): Likewise. (MAKE-PARSE-FUNCTION): Likewise. diff --git a/src/interp/Makefile.in b/src/interp/Makefile.in index e4201fd6..f9e427d9 100644 --- a/src/interp/Makefile.in +++ b/src/interp/Makefile.in @@ -387,7 +387,7 @@ sys-constants.$(FASLEXT): types.$(FASLEXT) hash.$(FASLEXT): types.$(FASLEXT) union.$(FASLEXT): vmlisp.$(FASLEXT) ggreater.$(FASLEXT): vmlisp.$(FASLEXT) -lisp-backend.$(FASLEXT): sys-macros.$(FASLEXT) +lisp-backend.$(FASLEXT): sys-macros.$(FASLEXT) nlib.$(FASLEXT) sys-utility.$(FASLEXT): vmlisp.$(FASLEXT) sys-os.$(FASLEXT) hash.$(FASLEXT) vmlisp.$(FASLEXT): types.$(FASLEXT) sys-globals.$(FASLEXT) io.$(FASLEXT): sys-constants.$(FASLEXT) diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index a24b4539..404bbe9a 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -1290,11 +1290,12 @@ clearReplacement name == ++ Register the inlinable form of a function. registerFunctionReplacement(name,body) == - LAM_,EVALANDFILEACTQ ["PUT",MKQ name,MKQ "SPADreplace",quoteMinimally body] + evalAndPrintBackendStmt + ["PUT",MKQ name,MKQ "SPADreplace",quoteMinimally body] ++ Remember the redex form of this function registerRedexForm(name,parms,body) == - LAM_,EVALANDFILEACTQ + evalAndPrintBackendStmt ["PUT",quote name,quote '%redex,quote ['ILAM,parms,body]] ++ Retrieve the redex form of the function `name'. @@ -1461,7 +1462,7 @@ setCompilerOptimizations level == ++ Note that all capsule functions take an additional argument ++ standing for the domain of computation object. proclaimCapsuleFunction(op,sig) == - LAM_,EVALANDFILEACTQ + printBackendStmt ["DECLAIM",["FTYPE", ["FUNCTION",[:[vmType first d for d in tails rest sig],"%Shell"], vmType first sig],op]] where diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot index 35230f86..acf96392 100644 --- a/src/interp/lisp-backend.boot +++ b/src/interp/lisp-backend.boot @@ -37,11 +37,15 @@ --% import sys_-macros +import nlib namespace BOOT module lisp_-backend where expandToVMForm: %Thing -> %Thing eval: %Thing -> %Thing + printBackendStmt: %Code -> %Void + printBackendDecl: (%Symbol,%Code) -> %Void + evalAndPrintBackendStmt: %Code -> %Void --% @@ -815,3 +819,21 @@ assembleCode x == if not $COMPILE then SAY '"No Compilation" else COMP370 x first x + +printBackendStmt stmt == + printBackendDecl(nil,stmt) + +evalAndPrintBackendStmt stmt == + eval stmt + printBackendStmt stmt + +printBackendDecl(label,decl) == + st := + sp := symbolAssoc('COMPILER_-OUTPUT_-STREAM,OPTIONLIST) => rest sp + $OutputStream + if label ~= nil and ioTerminal? st and FBOUNDP label + and not COMPILED_-FUNCTION_-P symbolFunction label then + COMPILE label + if $PrettyPrint or not ioTerminal? st then + PRINT_-FULL(decl,st) + flushOutput st diff --git a/src/interp/macros.lisp b/src/interp/macros.lisp index 7044e6e1..ceb57807 100644 --- a/src/interp/macros.lisp +++ b/src/interp/macros.lisp @@ -61,8 +61,6 @@ ; 5.3 Top-Level Forms -(defun SETANDFILE (x y) (LAM\,EVALANDFILEACTQ `(defparameter ,x ',y))) - ; 6 PREDICATES ; 6.3 Equality Predicates diff --git a/src/interp/slam.boot b/src/interp/slam.boot index 5a74a0cb..2a8b0745 100644 --- a/src/interp/slam.boot +++ b/src/interp/slam.boot @@ -413,7 +413,7 @@ compQuietly fn == $InteractiveMode => $compileDontDefineFunctions => "COMPILE-DEFUN" "EVAL-DEFUN" - "PRINT-DEFUN" + function printBackendDecl quietlyIfInteractive backendCompile fn clearAllSlams x == diff --git a/src/interp/spad.lisp b/src/interp/spad.lisp index 78d6cc66..d11a5aae 100644 --- a/src/interp/spad.lisp +++ b/src/interp/spad.lisp @@ -86,8 +86,8 @@ (*spad-output-file* nil) &aux ;; (*comp370-apply* (function print-and-eval-defun)) - (*comp370-apply* (function print-defun)) - (*fileactq-apply* (function print-defun)) + (*comp370-apply* (function |printBackendDecl|)) + (*fileactq-apply* (function |printBackendDecl|)) ($SPAD T) (OPTIONLIST nil) (*EOF* NIL) diff --git a/src/interp/sys-utility.boot b/src/interp/sys-utility.boot index 31168d54..52d79213 100644 --- a/src/interp/sys-utility.boot +++ b/src/interp/sys-utility.boot @@ -254,7 +254,7 @@ EVAL_-DEFUN(name,body) == PRINT_-AND_-EVAL_-DEFUN(name,body) == eval body - PRINT_-DEFUN(name,body) + printBackendDecl(name,body) --% Hash table diff --git a/src/interp/vmlisp.lisp b/src/interp/vmlisp.lisp index 4277b954..b60b66b5 100644 --- a/src/interp/vmlisp.lisp +++ b/src/interp/vmlisp.lisp @@ -106,7 +106,7 @@ (defmacro |equal| (x y) `(equalp ,x ,y)) -(defmacro evalandfileactq (name &optional (form name)) +(defmacro evalandfileactq (name form) `(eval-when #+:common-lisp (:load-toplevel :execute) #-:common-lisp (eval load) @@ -1185,11 +1185,15 @@ ; 99.0 Ancient Stuff We Decided To Keep -(defun LAM\,EVALANDFILEACTQ (name &optional (form name)) - (LAM\,FILEACTQ name form) (eval form)) +(defun SETANDFILE (x y) (LAM\,EVALANDFILEACTQ x `(defparameter ,x ',y))) + +(defun LAM\,EVALANDFILEACTQ (name form) + (LAM\,FILEACTQ name form) + (eval form)) (defun LAM\,FILEACTQ (name form) - (if *FILEACTQ-APPLY* (FUNCALL *FILEACTQ-APPLY* name form))) + (if *FILEACTQ-APPLY* + (FUNCALL *FILEACTQ-APPLY* name form))) (defun PLACEP (item) (eq item *read-place-holder*)) (defun VMREAD (&optional (st |$InputStream|) (eofval *read-place-holder*)) |