From e609586105f5a9b2b314a9dbeab0e7ec47d66b85 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 28 Mar 2008 04:34:35 +0000 Subject: * interp/int-top.boot (intloopReadConsole): Use $InputStream. * interp/bootlex.lisp (init-boot/spad-reader): Use $OutputStream. * interp/comp.lisp (|compQuietly|): Likewise. (|compileFileQuietly|): Likewise. (|compileQuietly|): Likewise. * interp/unlisp.lisp (|Prompt|): Likewise. * interp/server.boot (serverReadLine): Indent while body. --- src/ChangeLog | 10 ++++++ src/driver/utils.c | 16 ++++++++- src/interp/bootlex.lisp | 2 +- src/interp/comp.lisp | 22 ++++++++----- src/interp/int-top.boot | 2 +- src/interp/server.boot | 88 ++++++++++++++++++++++++------------------------- src/interp/unlisp.lisp | 4 +-- src/lib/Makefile.in | 2 ++ src/lisp/core.lisp.in | 2 +- 9 files changed, 90 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 68b90aeb..7ab9ec79 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2008-03-27 Gabriel Dos Reis + + * interp/int-top.boot (intloopReadConsole): Use $InputStream. + * interp/bootlex.lisp (init-boot/spad-reader): Use $OutputStream. + * interp/comp.lisp (|compQuietly|): Likewise. + (|compileFileQuietly|): Likewise. + (|compileQuietly|): Likewise. + * interp/unlisp.lisp (|Prompt|): Likewise. + * interp/server.boot (serverReadLine): Indent while body. + 2008-03-27 Gabriel Dos Reis * lib/Makefile.in: Fix DLL build on Cygwin. diff --git a/src/driver/utils.c b/src/driver/utils.c index 3d5874da..c319536f 100644 --- a/src/driver/utils.c +++ b/src/driver/utils.c @@ -14,7 +14,7 @@ the documentation and/or other materials provided with the distribution. - - Neither the name of The Numerical ALgorithms Group Ltd. nor the + - Neither the name of The Numerical Algorithms Group Ltd. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -139,6 +139,15 @@ openaxiom_build_rts_options(openaxiom_command* command, command->rt_argv[1] = "-eval"; command->rt_argv[2] = "(" OPENAXIOM_LISP_CORE_ENTRY_POINT ")"; break; + + case openaxiom_sbcl_runtime: + command->rt_argc = 3; + command->rt_argv = (char **) + malloc(command->rt_argc * sizeof (char*)); + command->rt_argv[0] = "--noprint"; + command->rt_argv[1] = "--noinform"; + command->rt_argv[2] = "--end-runtime-options"; + break; default: abort(); @@ -175,6 +184,11 @@ openaxiom_preprocess_arguments(openaxiom_command* command, driver = openaxiom_script_driver; else if(strcmp(argv[i], "--compile") == 0) driver = openaxiom_compiler_driver; + else if(strcmp(argv[i], "--no-server") == 0) + driver = openaxiom_core_driver; + else if (strcmp(argv[i], "--server") == 0) + driver = openaxiom_sman_driver; + openaxiom_build_rts_options(command, driver); return driver; diff --git a/src/interp/bootlex.lisp b/src/interp/bootlex.lisp index fbabfd21..fc446aa1 100644 --- a/src/interp/bootlex.lisp +++ b/src/interp/bootlex.lisp @@ -55,7 +55,7 @@ (defun init-boot/spad-reader () (setq $SPAD_ERRORS (VECTOR 0 0 0)) - (setq SPADERRORSTREAM *standard-output*) + (setq SPADERRORSTREAM |$OutputStream|) (setq XTokenReader 'get-BOOT-token) (setq Line-Handler 'next-BOOT-line) (setq Meta_Error_Handler 'spad_syntax_error) diff --git a/src/interp/comp.lisp b/src/interp/comp.lisp index a804692d..870bcb63 100644 --- a/src/interp/comp.lisp +++ b/src/interp/comp.lisp @@ -86,12 +86,15 @@ (defun |compQuietly| (fn) (let ((*comp370-apply* (if |$InteractiveMode| - (if |$compileDontDefineFunctions| #'compile-defun #'eval-defun) + (if |$compileDontDefineFunctions| + #'compile-defun + #'eval-defun) #'print-defun)) ;; following creates a null outputstream if $InteractiveMode (|$OutputStream| - (if |$InteractiveMode| (make-broadcast-stream) - *standard-output*))) + (if |$InteractiveMode| + (make-broadcast-stream) + (make-synonym-stream *standard-output*)))) (COMP fn))) #-:CCL @@ -100,7 +103,7 @@ ;; following creates a null outputstream if $InteractiveMode (|$OutputStream| (if |$InteractiveMode| (make-broadcast-stream) - *standard-output*))) + (make-synonym-stream *standard-output*)))) (COMPILE-FILE fn))) #+:CCL @@ -154,12 +157,15 @@ (defun |compileQuietly| (fn) (let ((*comp370-apply* (if |$InteractiveMode| - (if |$compileDontDefineFunctions| #'compile-defun #'eval-defun) + (if |$compileDontDefineFunctions| + #'compile-defun + #'eval-defun) #'print-defun)) - ;; following creates a null outputstream if $InteractiveMode + ;; following creates a null outputstream if $InteractiveMode (|$OutputStream| - (if |$InteractiveMode| (make-broadcast-stream) - *standard-output*))) + (if |$InteractiveMode| + (make-broadcast-stream) + (make-synonym-stream *standard-output*)))) (COMP370 fn))) (defun COMP-1 (X) diff --git a/src/interp/int-top.boot b/src/interp/int-top.boot index 5e88dd71..645577e1 100644 --- a/src/interp/int-top.boot +++ b/src/interp/int-top.boot @@ -145,7 +145,7 @@ SpadInterpretStream(str, source, interactive?) == ----------------------------------------------------------------- intloopReadConsole(b, n)== - a:= serverReadLine(_*STANDARD_-INPUT_*) + a:= serverReadLine $InputStream not STRINGP a => leaveScratchpad() #a=0 => PRINC(MKPROMPT()) diff --git a/src/interp/server.boot b/src/interp/server.boot index 130cf887..33779dc1 100644 --- a/src/interp/server.boot +++ b/src/interp/server.boot @@ -55,50 +55,50 @@ serverReadLine(stream) == _*EOF_*: fluid := NIL line := while not $EndServerSession and not _*EOF_* repeat - if $NeedToSignalSessionManager then - sockSendInt($SessionManager, $EndOfOutput) - $NeedToSignalSessionManager := false - action := serverSwitch() - action = $CallInterp => - l := read_-line(stream) - $NeedToSignalSessionManager := true - return l - action = $CreateFrame => - frameName := GENSYM('"frame") - addNewInterpreterFrame(frameName) - $frameAlist := [[$frameNumber,:frameName], :$frameAlist] - $currentFrameNum := $frameNumber - sockSendInt($SessionManager, $frameNumber) - $frameNumber := $frameNumber + 1 - sockSendString($SessionManager, MKPROMPT()) - action = $SwitchFrames => - $currentFrameNum := sockGetInt($SessionManager) - currentFrame := LASSOC($currentFrameNum, $frameAlist) - changeToNamedInterpreterFrame currentFrame - action = $EndSession => - $EndServerSession := true - action = $LispCommand => - $NeedToSignalSessionManager := true - stringBuf := MAKE_-STRING $sockBufferLength - sockGetString($MenuServer, stringBuf, $sockBufferLength) - form := unescapeStringsInForm READ_-FROM_-STRING stringBuf - protectedEVAL form - action = $QuietSpadCommand => - $NeedToSignalSessionManager := true - executeQuietCommand() - action = $SpadCommand => - $NeedToSignalSessionManager := true - stringBuf := MAKE_-STRING 512 - sockGetString($MenuServer, stringBuf, 512) - CATCH('coerceFailure,CATCH('top__level, CATCH('SPAD__READER, - parseAndInterpret stringBuf))) - PRINC MKPROMPT() - FINISH_-OUTPUT() - action = $NonSmanSession => - $SpadServer := nil - action = $KillLispSystem => - coreQuit() -- ??? should be coreQuit errorCount() - NIL + if $NeedToSignalSessionManager then + sockSendInt($SessionManager, $EndOfOutput) + $NeedToSignalSessionManager := false + action := serverSwitch() + action = $CallInterp => + l := read_-line(stream) + $NeedToSignalSessionManager := true + return l + action = $CreateFrame => + frameName := GENSYM('"frame") + addNewInterpreterFrame(frameName) + $frameAlist := [[$frameNumber,:frameName], :$frameAlist] + $currentFrameNum := $frameNumber + sockSendInt($SessionManager, $frameNumber) + $frameNumber := $frameNumber + 1 + sockSendString($SessionManager, MKPROMPT()) + action = $SwitchFrames => + $currentFrameNum := sockGetInt($SessionManager) + currentFrame := LASSOC($currentFrameNum, $frameAlist) + changeToNamedInterpreterFrame currentFrame + action = $EndSession => + $EndServerSession := true + action = $LispCommand => + $NeedToSignalSessionManager := true + stringBuf := MAKE_-STRING $sockBufferLength + sockGetString($MenuServer, stringBuf, $sockBufferLength) + form := unescapeStringsInForm READ_-FROM_-STRING stringBuf + protectedEVAL form + action = $QuietSpadCommand => + $NeedToSignalSessionManager := true + executeQuietCommand() + action = $SpadCommand => + $NeedToSignalSessionManager := true + stringBuf := MAKE_-STRING 512 + sockGetString($MenuServer, stringBuf, 512) + CATCH('coerceFailure,CATCH('top__level, CATCH('SPAD__READER, + parseAndInterpret stringBuf))) + PRINC MKPROMPT() + FINISH_-OUTPUT() + action = $NonSmanSession => + $SpadServer := nil + action = $KillLispSystem => + coreQuit() + nil line => line "" diff --git a/src/interp/unlisp.lisp b/src/interp/unlisp.lisp index 640d99bc..38804adc 100644 --- a/src/interp/unlisp.lisp +++ b/src/interp/unlisp.lisp @@ -91,8 +91,8 @@ (defun |Prompt| (line &optional (readfn nil)) - (format *query-io* "~a" line) - (when readfn (apply readfn (list *query-io*))) ) + (format |$OutputStream| "~a" line) + (when readfn (apply readfn (list |$InputStream|))) ) (defun |PrettyPrint| (expr &optional (outstream |$OutputStream|)) (write expr :stream outstream :level nil :length nil :pretty 't :escape 't) diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in index 2554cbae..419bd1c5 100644 --- a/src/lib/Makefile.in +++ b/src/lib/Makefile.in @@ -32,7 +32,9 @@ core_SOURCES = bsdsignal.c cfuns-c.c sockio-c.c + terminal_io_SOURCES = cursor.c edin.c fnct_key.c openpty.c prt.c wct.c + graphics_SOURCES = \ halloc.c \ hash.c \ diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in index 52375325..c6ba6cd3 100644 --- a/src/lisp/core.lisp.in +++ b/src/lisp/core.lisp.in @@ -479,7 +479,7 @@ (defun |handleRequest| (prog-name request options args) (let ((driver (|getDriver| request))) (when (null driver) - (|fatalError| (format nil "invalid option ~S" request))) + (|fatalError| (format nil "invalid option `--~a'" (string request)))) (funcall driver prog-name options args))) (defun |hasHandler?| (request) -- cgit v1.2.3