aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-03-28 04:34:35 +0000
committerdos-reis <gdr@axiomatics.org>2008-03-28 04:34:35 +0000
commite609586105f5a9b2b314a9dbeab0e7ec47d66b85 (patch)
treed7d301cc8060f30154dff07b334cbc67e636432d /src/interp
parentbd0ce3e3c5dfaad8adcb5034d9637267ed6bc857 (diff)
downloadopen-axiom-e609586105f5a9b2b314a9dbeab0e7ec47d66b85.tar.gz
* 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.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/bootlex.lisp2
-rw-r--r--src/interp/comp.lisp22
-rw-r--r--src/interp/int-top.boot2
-rw-r--r--src/interp/server.boot88
-rw-r--r--src/interp/unlisp.lisp4
5 files changed, 62 insertions, 56 deletions
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)