diff options
author | dos-reis <gdr@axiomatics.org> | 2008-03-25 21:33:58 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-03-25 21:33:58 +0000 |
commit | 68c6afce19df6a92b0569a23bcfe3a73f109b754 (patch) | |
tree | 4091c71856bf51388d07c677191ba13d2457128a | |
parent | daed04c57b8ff8c3be53a5a183635c5687ab7bf6 (diff) | |
download | open-axiom-68c6afce19df6a92b0569a23bcfe3a73f109b754.tar.gz |
* interp/bootlex.lisp: Import "sys-globals".
Consistently use $InputStream and $OutputStream for I/O.
* interp/c-util.boot: Likewise.
* interp/comp.lisp: Likewise.
* interp/compat.boot: Likewise.
* interp/debug.lisp: Likewise.
* interp/def.lisp: Likewise.
* interp/g-error.boot: Likewise.
* interp/i-toplev.boot: Likewise.
* interp/int-top.boot: Likewise.
* interp/intfile.boot: Likewise.
* interp/lisplib.boot: Likewise.
* interp/macros.lisp: Likewise.
* interp/metalex.lisp: Likewise.
* interp/msgdb.boot: Likewise.
* interp/patches.lisp: Likewise.
* interp/preparse.lisp: Likewise.
* interp/server.boot: Likewise.
* interp/spad-parser.boot: Likewise.
* interp/spad.lisp: Likewise.
* interp/sys-globals.boot: Likewise.
* interp/sys-macros.lisp: Likewise.
* interp/sys-os.boot: Likewise.
* interp/unlisp.lisp: Likewise.
* interp/vmlisp.lisp: Likewise.
* interp/Makefile.pamphlet (bootlex.$(FASLEXT)): Require
sys-globals.$(FASLEXT) too.
(vmlisp.$(FASLEXT)): Likewise.
32 files changed, 187 insertions, 153 deletions
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for OpenAxiom 1.2.0-2008-03-24. +# Generated by GNU Autoconf 2.60 for OpenAxiom 1.2.0-2008-03-25. # # Report bugs to <open-axiom-bugs@lists.sf.net>. # @@ -713,8 +713,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='OpenAxiom' PACKAGE_TARNAME='openaxiom' -PACKAGE_VERSION='1.2.0-2008-03-24' -PACKAGE_STRING='OpenAxiom 1.2.0-2008-03-24' +PACKAGE_VERSION='1.2.0-2008-03-25' +PACKAGE_STRING='OpenAxiom 1.2.0-2008-03-25' PACKAGE_BUGREPORT='open-axiom-bugs@lists.sf.net' ac_unique_file="src/Makefile.pamphlet" @@ -1394,7 +1394,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures OpenAxiom 1.2.0-2008-03-24 to adapt to many kinds of systems. +\`configure' configures OpenAxiom 1.2.0-2008-03-25 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1464,7 +1464,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of OpenAxiom 1.2.0-2008-03-24:";; + short | recursive ) echo "Configuration of OpenAxiom 1.2.0-2008-03-25:";; esac cat <<\_ACEOF @@ -1568,7 +1568,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -OpenAxiom configure 1.2.0-2008-03-24 +OpenAxiom configure 1.2.0-2008-03-25 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1582,7 +1582,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by OpenAxiom $as_me 1.2.0-2008-03-24, which was +It was created by OpenAxiom $as_me 1.2.0-2008-03-25, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -25457,7 +25457,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by OpenAxiom $as_me 1.2.0-2008-03-24, which was +This file was extended by OpenAxiom $as_me 1.2.0-2008-03-25, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25506,7 +25506,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -OpenAxiom config.status 1.2.0-2008-03-24 +OpenAxiom config.status 1.2.0-2008-03-25 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 8537b59f..8c52a72c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ sinclude(config/open-axiom.m4) sinclude(config/aclocal.m4) -AC_INIT([OpenAxiom], [1.2.0-2008-03-24], +AC_INIT([OpenAxiom], [1.2.0-2008-03-25], [open-axiom-bugs@lists.sf.net]) AC_CONFIG_AUX_DIR(config) diff --git a/configure.ac.pamphlet b/configure.ac.pamphlet index 27b07b78..b53b53d4 100644 --- a/configure.ac.pamphlet +++ b/configure.ac.pamphlet @@ -1078,7 +1078,7 @@ information: <<Autoconf init>>= sinclude(config/open-axiom.m4) sinclude(config/aclocal.m4) -AC_INIT([OpenAxiom], [1.2.0-2008-03-24], +AC_INIT([OpenAxiom], [1.2.0-2008-03-25], [open-axiom-bugs@lists.sf.net]) @ diff --git a/src/ChangeLog b/src/ChangeLog index df65100f..9ced4373 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,34 @@ +2008-03-25 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * interp/bootlex.lisp: Import "sys-globals". + Consistently use $InputStream and $OutputStream for I/O. + * interp/c-util.boot: Likewise. + * interp/comp.lisp: Likewise. + * interp/compat.boot: Likewise. + * interp/debug.lisp: Likewise. + * interp/def.lisp: Likewise. + * interp/g-error.boot: Likewise. + * interp/i-toplev.boot: Likewise. + * interp/int-top.boot: Likewise. + * interp/intfile.boot: Likewise. + * interp/lisplib.boot: Likewise. + * interp/macros.lisp: Likewise. + * interp/metalex.lisp: Likewise. + * interp/msgdb.boot: Likewise. + * interp/patches.lisp: Likewise. + * interp/preparse.lisp: Likewise. + * interp/server.boot: Likewise. + * interp/spad-parser.boot: Likewise. + * interp/spad.lisp: Likewise. + * interp/sys-globals.boot: Likewise. + * interp/sys-macros.lisp: Likewise. + * interp/sys-os.boot: Likewise. + * interp/unlisp.lisp: Likewise. + * interp/vmlisp.lisp: Likewise. + * interp/Makefile.pamphlet (bootlex.$(FASLEXT)): Require + sys-globals.$(FASLEXT) too. + (vmlisp.$(FASLEXT)): Likewise. + 2008-03-24 Gabriel Dos Reis <gdr@cs.tamu.edu> * interp/vmlisp.lisp (DEFINE-FUNCTION): Move boot-pkg.lisp. diff --git a/src/input/Makefile.in b/src/input/Makefile.in index 52ccd819..2c1195b0 100644 --- a/src/input/Makefile.in +++ b/src/input/Makefile.in @@ -744,7 +744,7 @@ all-check: ${OUTS} echo ')set message test on' > tmp.input; \ echo ')set message auto off' >> tmp.input ; \ echo ')read $*' >> tmp.input ; \ - echo ')lisp (|coreQuit|)' >> tmp.input ; \ + echo ')boot coreQuit()' >> tmp.input ; \ echo 'systemCommand "read tmp.input"' | ${TESTSYS} | tee $*.output; \ rm tmp.input ) diff --git a/src/input/Makefile.pamphlet b/src/input/Makefile.pamphlet index 24956a19..484e1501 100644 --- a/src/input/Makefile.pamphlet +++ b/src/input/Makefile.pamphlet @@ -361,7 +361,7 @@ all-check: ${OUTS} echo ')set message test on' > tmp.input; \ echo ')set message auto off' >> tmp.input ; \ echo ')read $*' >> tmp.input ; \ - echo ')lisp (|coreQuit|)' >> tmp.input ; \ + echo ')boot coreQuit()' >> tmp.input ; \ echo 'systemCommand "read tmp.input"' | ${TESTSYS} | tee $*.output; \ rm tmp.input ) diff --git a/src/interp/Makefile.in b/src/interp/Makefile.in index a66c5dad..c5e2c4a9 100644 --- a/src/interp/Makefile.in +++ b/src/interp/Makefile.in @@ -522,7 +522,7 @@ postpar.$(FASLEXT): postpar.boot macros.$(FASLEXT) $(BOOTSYS) --compile --boot="old" --output=$@ --load-directory=. $< bootlex.$(FASLEXT): bootlex.lisp preparse.$(FASLEXT) def.$(FASLEXT) \ - nlib.$(FASLEXT) + nlib.$(FASLEXT) sys-globals.$(FASLEXT) $(BOOTSYS) --compile --output=$@ --load-directory=. $< newaux.$(FASLEXT): newaux.lisp macros.$(FASLEXT) @@ -751,7 +751,7 @@ foam_l.$(FASLEXT): foam_l.lisp vmlisp.$(FASLEXT) sys-utility.$(FASLEXT): sys-utility.boot vmlisp.$(FASLEXT) sys-os.$(FASLEXT) $(BOOTSYS) --compile --output=$@ --load-directory=. $< -vmlisp.$(FASLEXT): vmlisp.lisp types.$(FASLEXT) +vmlisp.$(FASLEXT): vmlisp.lisp types.$(FASLEXT) sys-globals.$(FASLEXT) $(BOOTSYS) --compile --output=$@ --load-directory=. $< sys-os.$(FASLEXT): sys-os.boot types.$(FASLEXT) \ diff --git a/src/interp/Makefile.pamphlet b/src/interp/Makefile.pamphlet index 378c6155..d1925c5b 100644 --- a/src/interp/Makefile.pamphlet +++ b/src/interp/Makefile.pamphlet @@ -824,7 +824,7 @@ postpar.$(FASLEXT): postpar.boot macros.$(FASLEXT) $(BOOTSYS) --compile --boot="old" --output=$@ --load-directory=. $< bootlex.$(FASLEXT): bootlex.lisp preparse.$(FASLEXT) def.$(FASLEXT) \ - nlib.$(FASLEXT) + nlib.$(FASLEXT) sys-globals.$(FASLEXT) $(BOOTSYS) --compile --output=$@ --load-directory=. $< newaux.$(FASLEXT): newaux.lisp macros.$(FASLEXT) @@ -1053,7 +1053,7 @@ foam_l.$(FASLEXT): foam_l.lisp vmlisp.$(FASLEXT) sys-utility.$(FASLEXT): sys-utility.boot vmlisp.$(FASLEXT) sys-os.$(FASLEXT) $(BOOTSYS) --compile --output=$@ --load-directory=. $< -vmlisp.$(FASLEXT): vmlisp.lisp types.$(FASLEXT) +vmlisp.$(FASLEXT): vmlisp.lisp types.$(FASLEXT) sys-globals.$(FASLEXT) $(BOOTSYS) --compile --output=$@ --load-directory=. $< sys-os.$(FASLEXT): sys-os.boot types.$(FASLEXT) \ diff --git a/src/interp/bootlex.lisp b/src/interp/bootlex.lisp index 7c74fac9..fbabfd21 100644 --- a/src/interp/bootlex.lisp +++ b/src/interp/bootlex.lisp @@ -43,6 +43,7 @@ ; 4. BOOT Token Parsing Actions ; 5. BOOT Error Handling +(import-module "sys-globals") (IMPORT-MODULE "preparse") (IMPORT-MODULE "def") (IMPORT-MODULE "nlib") @@ -67,12 +68,12 @@ `(progn (setq spaderrorstream t) (in-boot) - (initialize-preparse *terminal-io*) + (initialize-preparse |$InputStream|) (,(intern (strconc "PARSE-" x)) . ,y))) (defun print-defun (name body) (let* ((sp (assoc 'compiler-output-stream optionlist)) - (st (if sp (cdr sp) *standard-output*))) + (st (if sp (cdr sp) |$OutputStream|))) (if (and (is-console st) (symbolp name) (fboundp name) (not (compiled-function-p (symbol-function name)))) (compile name)) @@ -118,14 +119,12 @@ (with-open-stream (in-stream (if *boot-input-file* (open *boot-input-file* :direction :input) - *standard-input*)) + |$InputStream|)) (initialize-preparse in-stream) (with-open-stream (out-stream (if *boot-output-file* (open *boot-output-file* :direction :output) - #-:cmulisp (make-broadcast-stream *standard-output*) - #+:cmulisp *standard-output* - )) + (make-broadcast-stream |$OutputStream|))) (when *boot-output-file* (format out-stream "~&;;; -*- Mode:Lisp; Package:Boot -*-~%~%") (print-package "BOOT")) @@ -136,7 +135,7 @@ (let ((parseout (pop-stack-1)) ) (setq parseout (|new2OldLisp| parseout)) (setq parseout (DEF-RENAME parseout)) - (let ((*standard-output* out-stream)) + (let ((|$OutputStream| out-stream)) (DEF-PROCESS parseout)) (format out-stream "~&") (if (null parseout) (ioclear)) )) @@ -180,15 +179,15 @@ (progn (setq in-stream (if *spad-input-file* (open *spad-input-file* :direction :input) - *standard-input*)) + |$InputStream|)) (initialize-preparse in-stream) (setq out-stream (if *spad-output-file* (open *spad-output-file* :direction :output) - *standard-output*)) + |$OutputStream|)) (when *spad-output-file* (format out-stream "~&;;; -*- Mode:Lisp; Package:Boot -*-~%~%") (print-package "BOOT")) - (setq curoutstream out-stream) + (setq |$OutputStream| out-stream) (loop (if (or *eof* file-closed) (return nil)) (catch 'SPAD_READER @@ -198,7 +197,7 @@ (|PARSE-NewExpr|) (let ((parseout (pop-stack-1)) ) (when parseout - (let ((*standard-output* out-stream)) + (let ((|$OutputStream| out-stream)) (S-PROCESS parseout)) (format out-stream "~&"))) ;(IOClear in-stream out-stream) diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index f5b1fd48..5b0885b6 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -1,4 +1,4 @@ --- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. -- Copyright (C) 2007-2008, Gabriel Dos Reis. -- All rights reserved. @@ -15,7 +15,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. -- @@ -78,7 +78,7 @@ displaySemanticErrors() == l:= NREVERSE $semanticErrorStack $semanticErrorStack:= nil sayBrightly bright '" Semantic Errors:" - displaySemanticError(l,CUROUTSTREAM) + displaySemanticError(l,$OutputStream) sayBrightly '" " displayWarnings() @@ -91,7 +91,7 @@ displayWarnings() == n=0 => nil sayBrightly bright '" Warnings:" l := NREVERSE $warningStack - displayWarning(l,CUROUTSTREAM) + displayWarning(l,$OutputStream) $warningStack:= nil sayBrightly '" " diff --git a/src/interp/comp.lisp b/src/interp/comp.lisp index 2f10f163..a804692d 100644 --- a/src/interp/comp.lisp +++ b/src/interp/comp.lisp @@ -1,6 +1,6 @@ -;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. ;; All rights reserved. -;; Copyright (C) 2007, Gabriel Dos Reis. +;; Copyright (C) 2007-2008, Gabriel Dos Reis. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without @@ -15,7 +15,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. ;; @@ -89,7 +89,7 @@ (if |$compileDontDefineFunctions| #'compile-defun #'eval-defun) #'print-defun)) ;; following creates a null outputstream if $InteractiveMode - (*standard-output* + (|$OutputStream| (if |$InteractiveMode| (make-broadcast-stream) *standard-output*))) (COMP fn))) @@ -98,7 +98,7 @@ (defun |compileFileQuietly| (fn) (let ( ;; following creates a null outputstream if $InteractiveMode - (*standard-output* + (|$OutputStream| (if |$InteractiveMode| (make-broadcast-stream) *standard-output*))) (COMPILE-FILE fn))) @@ -107,7 +107,7 @@ (defun |compileFileQuietly| (fn) (let ( ;; following creates a null outputstream if $InteractiveMode - (*standard-output* + (|$OutputStream| (if |$InteractiveMode| (make-broadcast-stream) *standard-output*))) ;; The output-library is not opened before use unless set explicitly (if (null output-library) @@ -157,7 +157,7 @@ (if |$compileDontDefineFunctions| #'compile-defun #'eval-defun) #'print-defun)) ;; following creates a null outputstream if $InteractiveMode - (*standard-output* + (|$OutputStream| (if |$InteractiveMode| (make-broadcast-stream) *standard-output*))) (COMP370 fn))) diff --git a/src/interp/compat.boot b/src/interp/compat.boot index 87e1227c..0288ab68 100644 --- a/src/interp/compat.boot +++ b/src/interp/compat.boot @@ -1,6 +1,6 @@ --- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007, Gabriel Dos Reis. +-- Copyright (C) 2007-2008, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -15,7 +15,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. -- @@ -81,5 +81,5 @@ makeBigFloat(mantissa,expon) == READLINE(:s) == s => read_-line(first s) - read_-line(_*STANDARD_-INPUT_*) + read_-line($InputStream) diff --git a/src/interp/debug.lisp b/src/interp/debug.lisp index 60be95ec..79bb979b 100644 --- a/src/interp/debug.lisp +++ b/src/interp/debug.lisp @@ -1,4 +1,4 @@ -;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. ;; All rights reserved. ;; Copyright (C) 2007-2008, Gabriel Dos Reis. ;; All rights reserved. @@ -15,7 +15,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. ;; @@ -114,7 +114,7 @@ (SETQ INFILE (/MKINFILENAM (/GETOPTION OPTIONS 'FROM))) (SETQ TO (/GETOPTION OPTIONS 'TO)) (if TO (SETQ TO (/MKOUTFILENAM (/GETOPTION OPTIONS 'TO) INFILE))) - (SETQ OUTSTREAM (if TO (DEFSTREAM TO 'OUTPUT) CUROUTSTREAM)) + (SETQ OUTSTREAM (if TO (DEFSTREAM TO 'OUTPUT) |$OutputStream|)) (RETURN (mapcar #'(lambda (fn) (/D-2 FN INFILE OUTSTREAM OP EFLG TFLG)) (or fnl (list /fn))))))) @@ -200,7 +200,7 @@ (STRINGIMAGE $LINENUMBER))) (SHUT INPUTSTREAM) ;(COND - ; ( (EQ (READ ERRORINSTREAM) 'ABORTPROCESS) + ; ( (EQ (READ |$InputStream|) 'ABORTPROCESS) ; (RETURN 'ABORT) ) ) ;;%% next is done in case the diskmode changed ;;(SETQ INFILE (|pathname| (IFCAR @@ -313,14 +313,14 @@ (SETQ FT (UPCASE (|object2Identifier| (|pathnameType| INFILE)))) (SETQ KEYLENGTH (STRINGLENGTH KEY)) (WHEN (> INITRECNO 1) ;; we think we know where it is - (POINT INITRECNO INPUTSTREAM) - (SETQ LN (READ-LINE INPUTSTREAM NIL NIL)) + (POINT INITRECNO |$InputStream|) + (SETQ LN (READ-LINE |$InputStream| NIL NIL)) (IF (AND LN (MATCH-FUNCTION-DEF FN KEY KEYLENGTH LN FT)) (RETURN INITRECNO))) (SETQ $LINENUMBER 0) - (POINT 0 INPUTSTREAM) -EXAMINE (SETQ RECNO (NOTE INPUTSTREAM)) - (SETQ LN (READ-LINE INPUTSTREAM NIL NIL)) + (POINT 0 |$InputStream|) +EXAMINE (SETQ RECNO (NOTE |$InputStream|)) + (SETQ LN (READ-LINE |$InputStream| NIL NIL)) (INCF $LINENUMBER) (if (NULL LN) (RETURN NIL)) (IF (MATCH-FUNCTION-DEF FN KEY KEYLENGTH LN FT) @@ -386,7 +386,7 @@ EXAMINE (SETQ RECNO (NOTE INPUTSTREAM)) (if (member (cons fun file) funfiles :test #'equal) (go loop)) (push (cons fun file) funfiles) (COND ((EQUAL FUN 'QUAD) (/RF-1 FILE)) - ((/D-2 FUN FILE CUROUTSTREAM OP NIL NIL))) + ((/D-2 FUN FILE |$OutputStream| OP NIL NIL))) (GO LOOP))) (DEFUN /WRITEUPDATE (FUN FN FT FM FTYPE OP) @@ -881,8 +881,8 @@ EXAMINE (SETQ RECNO (NOTE INPUTSTREAM)) (if (ATOM A) (LIST A) A)))) (defun /TRACELET-PRINT (X Y &AUX (/PRETTY 'T)) - (PRINC (STRCONC (PNAME X) ": ") *terminal-io*) - (MONITOR-PRINT Y *terminal-io*)) + (PRINC (STRCONC (PNAME X) ": ") |$OutputStream|) + (MONITOR-PRINT Y |$OutputStream|)) (defmacro /UNTRACELET (&rest L) `', (COND diff --git a/src/interp/def.lisp b/src/interp/def.lisp index bce042cc..9d684695 100644 --- a/src/interp/def.lisp +++ b/src/interp/def.lisp @@ -1,6 +1,6 @@ -;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. ;; All rights reserved. -;; Copyright (C) 2007, Gabriel Dos Reis. +;; Copyright (C) 2007-2008, Gabriel Dos Reis. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without @@ -15,7 +15,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. ;; @@ -107,7 +107,7 @@ foo defined inside of fum gets renamed as fum,foo.") (car (setq Y (cdr Y))) (car (setq Y (cdr Y))) (CONS 'WHERE (cons (car (setq Y (cdr Y))) (cddr X))))))) - ((IS-CONSOLE *STANDARD-OUTPUT*) + ((IS-CONSOLE |$OutputStream|) (SAY " VALUE = " (EVAL (DEFTRAN X)))) ((print-full (DEFTRAN X))))) diff --git a/src/interp/g-error.boot b/src/interp/g-error.boot index abba7c27..5e559762 100644 --- a/src/interp/g-error.boot +++ b/src/interp/g-error.boot @@ -1,6 +1,6 @@ --- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007, Gabriel Dos Reis. +-- Copyright (C) 2007-2008, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -15,7 +15,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. -- @@ -71,7 +71,7 @@ argumentDataError(argnum, condit, funname) == queryUser msg == -- display message and return reply sayBrightly msg - read_-line _*TERMINAL_-IO_* + read_-line $InputStream -- errorSupervisor is the old style error message trapper @@ -151,7 +151,7 @@ sayErrorly(errorLabel, msg) == sayErrorly1(errorLabel, msg) saturnSayErrorly(errorLabel, msg) == - SETQ(_*STANDARD_-OUTPUT_*, $texOutputStream) + SETQ($OutputStream, $texOutputStream) old := pushSatOutput("line") sayString '"\bgroup\color{red}" sayString '"\begin{verbatim}" diff --git a/src/interp/i-toplev.boot b/src/interp/i-toplev.boot index c37510aa..c6a6631e 100644 --- a/src/interp/i-toplev.boot +++ b/src/interp/i-toplev.boot @@ -83,7 +83,7 @@ start(:l) == $InteractiveFrame := makeInitialModemapFrame() initializeSystemCommands() initializeInterpreterFrameRing() - SETQ(ERROROUTSTREAM, + SETQ($ErrorStream, DEFIOSTREAM('((DEVICE . CONSOLE)(MODE . OUTPUT)),80,0)) setOutputAlgebra "%initialize%" loadExposureGroupData() diff --git a/src/interp/int-top.boot b/src/interp/int-top.boot index 116a0114..5e88dd71 100644 --- a/src/interp/int-top.boot +++ b/src/interp/int-top.boot @@ -1,6 +1,6 @@ --- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007, Gabriel Dos Reis. +-- Copyright (C) 2007-2008, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -15,7 +15,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. -- @@ -91,7 +91,7 @@ runspad() == ncTopLevel() == -- Top-level read-parse-eval-print loop for the interpreter. Uses -- the Bill Burge's parser. - IN_-STREAM: fluid := CURINSTREAM + IN_-STREAM: fluid := $InputStream _*EOF_*: fluid := NIL $InteractiveMode :fluid := true $BOOT: fluid := NIL @@ -102,8 +102,8 @@ ncTopLevel() == ncIntLoop() == - CURINSTREAM : local := _*STANDARD_-OUTPUT_* - CUROUTSTREAM : local := _*STANDARD_-INPUT_* + $InputStream : local := MAKE_-SYNONYM_-STREAM "*STANDARD-INPUT*" + $OutputStream : local := MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*" intloop() diff --git a/src/interp/intfile.boot b/src/interp/intfile.boot index f17a1110..d80dc82d 100644 --- a/src/interp/intfile.boot +++ b/src/interp/intfile.boot @@ -1,6 +1,6 @@ --- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007, Gabriel Dos Reis. +-- Copyright (C) 2007-2008, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -15,7 +15,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. -- @@ -38,7 +38,7 @@ import '"cstream" shoeInternFile(fn)== a:=shoeInputFile fn if null a - then WRITE_-LINE (CONCAT(fn,'" not found"),_*TERMINAL_-IO_*) + then WRITE_-LINE (CONCAT(fn,'" not found"),$ErrorStream) else shoeIntern incRgen a shoeIntern (s)== diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot index f0ee53c2..52c73045 100644 --- a/src/interp/lisplib.boot +++ b/src/interp/lisplib.boot @@ -290,7 +290,7 @@ compileConstructorLib(l,op,editFlag,traceFlag) == outfile:= _/MKINFILENAM _/GETOPTION(options,'TO_=) res:= [compConLib1(fn,infile,outfile,op,editFlag,traceFlag) for fn in funList] - SHUT INPUTSTREAM + SHUT $InputStream res compConLib1(fun,infileOrNil,outfileOrNil,auxOp,editFlag,traceFlag) == diff --git a/src/interp/macros.lisp b/src/interp/macros.lisp index 922fa3ad..36dc31e8 100644 --- a/src/interp/macros.lisp +++ b/src/interp/macros.lisp @@ -329,7 +329,7 @@ ; 22.2.1 Input from Character Streams -(DEFUN STREAM-EOF (&optional (STRM *standard-input*)) +(DEFUN STREAM-EOF (&optional (STRM |$InputStream|)) "T if input stream STRM is at the end or saw a ~." (not (peek-char nil STRM nil nil nil)) ) @@ -372,9 +372,9 @@ ((PROGN (NEXTSTRMLINE STRM) (STRMBLANKLINE STRM)) STRM) ((STRMSKIPTOBLANK STRM)))) -(DEFUN CURINPUTLINE () (CURSTRMLINE *standard-input*)) +(DEFUN CURINPUTLINE () (CURSTRMLINE |$InputStream|)) -(DEFUN NEXTINPUTLINE () (NEXTSTRMLINE *standard-input*)) +(DEFUN NEXTINPUTLINE () (NEXTSTRMLINE |$InputStream|)) ; 22.3 Output Functions @@ -386,34 +386,38 @@ ((stringp x) x) ((write-to-string x)))) -(defvar |conOutStream| *standard-output* "console output stream") - (defun |sayTeX| (x) (if (null x) nil (sayBrightly1 x |$texOutputStream|))) (defun |sayNewLine| () (TERPRI)) (defvar |$sayBrightlyStream| nil "if not nil, gives stream for sayBrightly output") -(defun |sayBrightly| (x &optional (out-stream *standard-output*)) +(defun |sayBrightly| (x &optional (out-stream |$OutputStream|)) (COND ((NULL X) NIL) - (|$sayBrightlyStream| (sayBrightly1 X |$sayBrightlyStream|)) - ((IS-CONSOLE out-stream) (sayBrightly1 X out-stream)) - ((sayBrightly1 X out-stream) (sayBrightly1 X *standard-output*)))) - -(defun |sayBrightlyI| (x &optional (s *terminal-io*)) + (|$sayBrightlyStream| + (sayBrightly1 X |$sayBrightlyStream|)) + ((IS-CONSOLE out-stream) + (sayBrightly1 X out-stream)) + ((sayBrightly1 X out-stream) + (sayBrightly1 X |$OutputStream|)))) + +(defun |sayBrightlyI| (x &optional (s |$OutputStream|)) "Prints at console or output stream." (if (NULL X) NIL (sayBrightly1 X S))) -(defun |sayBrightlyNT| (x &optional (S *standard-output*)) +(defun |sayBrightlyNT| (x &optional (S |$OutputStream|)) (COND ((NULL X) NIL) - (|$sayBrightlyStream| (sayBrightlyNT1 X |$sayBrightlyStream|)) - ((IS-CONSOLE S) (sayBrightlyNT1 X S)) - ((sayBrightly1 X S) (sayBrightlyNT1 X *terminal-io*)))) - -(defun sayBrightlyNT1 (X *standard-output*) + (|$sayBrightlyStream| + (sayBrightlyNT1 X |$sayBrightlyStream|)) + ((IS-CONSOLE S) + (sayBrightlyNT1 X S)) + ((sayBrightly1 X S) + (sayBrightlyNT1 X |$OutputStream|)))) + +(defun sayBrightlyNT1 (X |$OutputStream|) (if (ATOM X) (BRIGHTPRINT-0 X) (BRIGHTPRINT X))) -(defun sayBrightly1 (X *standard-output*) +(defun sayBrightly1 (X |$OutputStream|) (if (ATOM X) (progn (BRIGHTPRINT-0 X) (TERPRI) (force-output)) (progn (BRIGHTPRINT X) (TERPRI) (force-output)))) @@ -452,7 +456,8 @@ ;; the following are redefined in MSGDB BOOT -(DEFUN BLANKS (N &optional (stream *standard-output*)) "Print N blanks." +(DEFUN BLANKS (N &optional (stream |$OutputStream|)) + "Print N blanks." (do ((i 1 (the fixnum(1+ i)))) ((> i N))(declare (fixnum i n)) (princ " " stream))) @@ -637,7 +642,7 @@ terminals and empty or at-end files. In Common Lisp, we must assume record size ('T NIL))))))) (COND ((> N |n|) NIL) ('T |word|)))))))))) -(defun print-full (expr &optional (stream *standard-output*)) +(defun print-full (expr &optional (stream |$OutputStream|)) (let ((*print-circle* t) (*print-array* t) *print-level* *print-length*) (print expr stream) (terpri stream) @@ -689,15 +694,13 @@ terminals and empty or at-end files. In Common Lisp, we must assume record size (let* ((out-stream (make-string-output-stream)) (curoutstream out-stream) (|$algebraOutputStream| out-stream) - (erroroutstream out-stream) + (|$OutputStream| out-stream) val) (declare (special curoutstream |$algebraOutputStream|)) - (setq *standard-output* out-stream) - (setq *terminal-io* out-stream) (setq val (catch 'spad_reader (catch 'TOP_LEVEL (apply (symbol-function func) args)))) - (cons val (get-output-stream-string *standard-output*)))) + (cons val (get-output-stream-string |$OutputStream|)))) (defun |breakIntoLines| (str) (let ((bol 0) (eol) (line-list nil)) diff --git a/src/interp/metalex.lisp b/src/interp/metalex.lisp index 06e13fc5..0d5c6e6b 100644 --- a/src/interp/metalex.lisp +++ b/src/interp/metalex.lisp @@ -1,6 +1,6 @@ -;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. ;; All rights reserved. -;; Copyright (C) 2007, Gabriel Dos Reis. +;; Copyright (C) 2007-2008, Gabriel Dos Reis. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without @@ -15,7 +15,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. ;; @@ -245,7 +245,7 @@ Symbolics read-line returns embedded newlines in a c-m-Y.") (defparameter Read-Quietly nil "Whether or not to produce an output listing. [local to PRINT-NEW-LINE]") -(defun Print-New-Line (string &optional (strm *terminal-io*)) +(defun Print-New-Line (string &optional (strm |$OutputStream|)) "Makes output listings." (if Read-Quietly (stack-push (copy-tree string) Printer-Line-Stack) (progn (mapc #'(lambda (x) (format strm "; ~A~%" x) (terpri)) diff --git a/src/interp/msgdb.boot b/src/interp/msgdb.boot index 1ed386db..63f80a76 100644 --- a/src/interp/msgdb.boot +++ b/src/interp/msgdb.boot @@ -1,4 +1,4 @@ --- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. -- Copyright (C) 2007-2008, Gabriel Dos Reis. -- All rights reserved. @@ -15,7 +15,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. -- @@ -342,7 +342,7 @@ throwKeyedMsg(key,args) == throwKeyedMsg1(key, args) saturnThrowKeyedMsg(key,args) == - SETQ(_*STANDARD_-OUTPUT_*, $texOutputStream) + SETQ($OutputStream, $texOutputStream) last := pushSatOutput("line") sayString '"\bgroup\color{red}\begin{list}\item{} " sayKeyedMsgAsTeX(key,args) @@ -351,7 +351,7 @@ saturnThrowKeyedMsg(key,args) == spadThrow() throwKeyedMsg1(key,args) == - SETQ(_*STANDARD_-OUTPUT_*, $texOutputStream) + SETQ($OutputStream, $texOutputStream) sayMSG '" " if $testingSystem then sayMSG $testingErrorPrefix sayKeyedMsg(key,args) @@ -386,7 +386,7 @@ keyedSystemError(key,args) == keyedSystemError1(key, args) saturnKeyedSystemError(key, args) == - SETQ(_*STANDARD_-OUTPUT_*, $texOutputStream) + SETQ($OutputStream, $texOutputStream) sayString '"\bgroup\color{red}" sayString '"\begin{verbatim}" sayKeyedMsg("S2GE0000",NIL) @@ -662,13 +662,13 @@ brightPrint0 x == x = '"%b" => -- FIXME: this kludge is GCL-specific. Find way to support -- highlighting on all supported Lisp. - NULL IS_-CONSOLE CUROUTSTREAM or %hasFeature KEYWORD::WIN32 + NULL IS_-CONSOLE $OutputStream or %hasFeature KEYWORD::WIN32 or stdStreamIsTerminal(1) = 0 => sayString '" " NULL $highlightAllowed => sayString '" " sayString $highlightFontOn k := blankIndicator x => BLANKS k x = '"%d" => - NULL IS_-CONSOLE CUROUTSTREAM or %hasFeature KEYWORD::WIN32 + NULL IS_-CONSOLE $OutputStream or %hasFeature KEYWORD::WIN32 or stdStreamIsTerminal(1) = 0 => sayString '" " NULL $highlightAllowed => sayString '" " sayString $highlightFontOff diff --git a/src/interp/patches.lisp b/src/interp/patches.lisp index ad744c3a..c1fd5781 100644 --- a/src/interp/patches.lisp +++ b/src/interp/patches.lisp @@ -191,7 +191,7 @@ (|untrace| NIL) (|clearClams|) ;; bind output to nulloutstream - (let ((*standard-output* (make-broadcast-stream))) + (let ((|$OutputStream| (make-broadcast-stream))) (|resetWorkspaceVariables|)) (setq |$specialCharacters| |$plainRTspecialCharacters|) diff --git a/src/interp/preparse.lisp b/src/interp/preparse.lisp index 8adb40e1..de612cfd 100644 --- a/src/interp/preparse.lisp +++ b/src/interp/preparse.lisp @@ -81,12 +81,12 @@ (with-open-stream (in-stream (or (and *boot-input-file* (open *boot-input-file* :direction :input)) - *standard-input*)) + |$InputStream|)) (declare (special in-stream)) (with-open-stream (out-stream (if *boot-output-file* (open *boot-output-file* :direction :output) - *standard-output*)) + |$OutputStream|)) (declare (special out-stream)) (initialize-preparse in-stream) (do ((lines (PREPARSE in-stream) (PREPARSE in-stream))) ((null lines))))) diff --git a/src/interp/server.boot b/src/interp/server.boot index 0462a5d4..130cf887 100644 --- a/src/interp/server.boot +++ b/src/interp/server.boot @@ -123,7 +123,7 @@ executeQuietCommand() == -- Includued for compatability with old-parser systems serverLoop() == - IN_-STREAM: fluid := CURINSTREAM + IN_-STREAM: fluid := $InputStream _*EOF_*: fluid := NIL while not $EndServerSession and not _*EOF_* repeat if $Prompt then (PRINC MKPROMPT(); FINISH_-OUTPUT()) @@ -131,7 +131,7 @@ serverLoop() == action := serverSwitch() action = $CallInterp => CATCH('coerceFailure,CATCH('top__level, CATCH('SPAD__READER, - parseAndInterpret read_-line(CURINSTREAM) ))) + parseAndInterpret read_-line($InputStream) ))) PRINC MKPROMPT() FINISH_-OUTPUT() sockSendInt($SessionManager, $EndOfOutput) diff --git a/src/interp/spad-parser.boot b/src/interp/spad-parser.boot index 7a26fb70..484e171c 100644 --- a/src/interp/spad-parser.boot +++ b/src/interp/spad-parser.boot @@ -1,4 +1,4 @@ --- Copyright (C) 2007, Gabriel Dos Reis. +-- Copyright (C) 2007-2008, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -13,7 +13,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. -- @@ -58,7 +58,7 @@ parseSpadFile sourceFile == SETQ(_*EOF_*, false) -- end of current input? FILE_-CLOSED : local := false -- current stream closed? - OUT_-STREAM : local := _*STANDARD_-OUTPUT_* -- noise to standard output + $OutputStream := MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*" -- noise to standard output -- we need tell the post-parsing transformers that we're compiling -- because few parse forms have slightly different representations -- depending on whether we are interpreter mode or compiler mode. diff --git a/src/interp/spad.lisp b/src/interp/spad.lisp index 0ef5b248..ee3dbd50 100644 --- a/src/interp/spad.lisp +++ b/src/interp/spad.lisp @@ -311,8 +311,8 @@ (|$genSDVar| 0) (|$VariableCount| 0) (|$previousTime| (TEMPUS-FUGIT))) - (prog ((CURSTRM CUROUTSTREAM) |$s| |$x| |$m| u) - (declare (special CURSTRM |$s| |$x| |$m| CUROUTSTREAM)) + (prog ((CURSTRM |$OutputStream|) |$s| |$x| |$m| u) + (declare (special CURSTRM |$s| |$x| |$m|)) (SETQ |$exitModeStack| ()) (SETQ |$postStack| nil) (SETQ |$TraceFlag| T) @@ -361,9 +361,9 @@ (SETQ SINGLELINEMODE T) ; SEE NewSYSTOK (SETQ NewFLAG T) (SETQ ULCASEFG T) - (setq STR (|New,ENTRY,2| '|PARSE-NewEXPR| '|process| curinstream)) + (setq STR (|New,ENTRY,2| '|PARSE-NewEXPR| '|process| |$InputStream|)) (if (/= 0 (setq N (NOTE STR))) - (progn (SETQ CURINSTREAM (POINTW N CURINSTREAM))) + (progn (SETQ |$InputStream| (POINTW N |$InputStream|))) ) '|END_OF_New|)) @@ -377,7 +377,7 @@ (defun INITIALIZE () (init-boot/spad-reader) - (initialize-preparse INPUTSTREAM)) + (initialize-preparse |$InputStream|)) (defmacro try (X) `(LET ((|$autoLine|)) diff --git a/src/interp/sys-globals.boot b/src/interp/sys-globals.boot index 4272ef81..fd6898d9 100644 --- a/src/interp/sys-globals.boot +++ b/src/interp/sys-globals.boot @@ -443,9 +443,6 @@ $insideCanCoerceFrom := nil ++ $sourceFiles := [] -++ ??? bogus initialization for now -INPUTSTREAM := "T" - ++ ??? $x := nil $f := nil @@ -460,13 +457,6 @@ _/SPACELIST := [] $algebraOutputStream := MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*" -ERROROUTSTREAM := - MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*" - - -ERRORINSTREAM := - MAKE_-SYNONYM_-STREAM "*STANDARD-INPUT*" - ++ $texOutputStream := MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*" @@ -482,3 +472,11 @@ conOutStream := +$InputStream := + MAKE_-SYNONYM_-STREAM "*STANDARD-INPUT*" + +$OutputStream := + MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*" + +$ErrorStream := + MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*" diff --git a/src/interp/sys-macros.lisp b/src/interp/sys-macros.lisp index 0f05af3b..a6d8dd9b 100644 --- a/src/interp/sys-macros.lisp +++ b/src/interp/sys-macros.lisp @@ -1257,7 +1257,7 @@ ;; (defmacro |shoeConsole| (line) - `(write-line ,line *standard-output*)) + `(write-line ,line |$OutputStream|)) (defmacro |shoeInputFile| (filespec) `(open ,filespec :direction :input :if-does-not-exist nil)) diff --git a/src/interp/sys-os.boot b/src/interp/sys-os.boot index 64d27abd..f3b04862 100644 --- a/src/interp/sys-os.boot +++ b/src/interp/sys-os.boot @@ -13,7 +13,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. -- @@ -168,5 +168,4 @@ minusInfinity() == ++ otherwise 0. import stdStreamIsTerminal for std__stream__is__terminal: int -> int - --% diff --git a/src/interp/unlisp.lisp b/src/interp/unlisp.lisp index 730e4d06..640d99bc 100644 --- a/src/interp/unlisp.lisp +++ b/src/interp/unlisp.lisp @@ -94,7 +94,7 @@ (format *query-io* "~a" line) (when readfn (apply readfn (list *query-io*))) ) -(defun |PrettyPrint| (expr &optional (outstream *standard-output*)) +(defun |PrettyPrint| (expr &optional (outstream |$OutputStream|)) (write expr :stream outstream :level nil :length nil :pretty 't :escape 't) (finish-output outstream) ) diff --git a/src/interp/vmlisp.lisp b/src/interp/vmlisp.lisp index eced41c2..25e848f2 100644 --- a/src/interp/vmlisp.lisp +++ b/src/interp/vmlisp.lisp @@ -32,6 +32,7 @@ ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (IMPORT-MODULE "types") +(import-module "sys-globals") ; VM LISP EMULATION PACKAGE ; Lars Ericson, Barry Trager, Martial Schor, tim daly, LVMCL, et al @@ -52,16 +53,8 @@ (defvar *comp370-apply* nil "function (name def) for comp370 to apply") -(defvar curinstream (make-synonym-stream '*standard-input*)) - -(defvar curoutstream (make-synonym-stream '*standard-output*)) - (defvar *embedded-functions* nil) -(defvar errorinstream (make-synonym-stream '*query-io*)) - -(defvar erroroutstream (make-synonym-stream '*query-io*)) - (defvar *fileactq-apply* nil "function to apply in fileactq") (defvar *lam-name* nil "name to be used by lam macro if non-nil") @@ -760,7 +753,15 @@ (system:fp-output-stream *terminal-io*)))) #-(OR Lucid KCL :CCL) -(defun IS-CONSOLE (stream) (EQ stream *terminal-io*)) +(defun IS-CONSOLE (stream) + (cond ((not (streamp stream)) + nil) + ((not (typep stream 'synonym-stream)) + nil) + ((eq (synonym-stream-symbol stream) '*standard-input*) + (|stdStreamIsTerminal| 0)) + ((eq (synonym-stream-symbol stream) '*standard-output*) + (|stdStreamIsTerminal| 1)))) ; 10.0 Control Structures @@ -1504,19 +1505,19 @@ (define-function 'printexp #'princ) (define-function 'prin0 #'prin1) -(defun |F,PRINT-ONE| (form &optional (stream *standard-output*)) +(defun |F,PRINT-ONE| (form &optional (stream |$OutputStream|)) (declare (ignore stream)) (let ((*print-level* 4) (*print-length* 4)) (prin1 form) (terpri))) -(defun prettyprint (x &optional (stream *standard-output*)) +(defun prettyprint (x &optional (stream |$OutputStream|)) (prettyprin0 x stream) (terpri stream)) -(defun prettyprin0 (x &optional (stream *standard-output*)) +(defun prettyprin0 (x &optional (stream |$OutputStream|)) (let ((*print-pretty* t) (*print-array* t)) (prin1 x stream))) -(defun vmprint (x &optional (stream *standard-output*)) +(defun vmprint (x &optional (stream |$OutputStream|)) (prin1 x stream) (terpri stream)) (defun tab (sint &optional (stream t)) @@ -1555,7 +1556,10 @@ (let ((mode (or (cdr (assoc 'MODE stream-alist)) 'INPUT)) (filename (cdr (assoc 'FILE stream-alist))) (dev (cdr (assoc 'DEVICE stream-alist)))) - (if (EQ dev 'CONSOLE) (make-synonym-stream '*terminal-io*) + (if (EQ dev 'CONSOLE) + (case mode + ((OUTPUT O) (make-synonym-stream '*standard-output*)) + ((INPUT I) (make-synonym-stream '*standard-input*))) (let ((strm (case mode ((OUTPUT O) (open (make-filename filename) :direction :output)) @@ -1785,7 +1789,7 @@ (define-function 'EVA1FUN #'EVALFUN) (defun PLACEP (item) (eq item *read-place-holder*)) -(defun VMREAD (&optional (st *standard-input*) (eofval *read-place-holder*)) +(defun VMREAD (&optional (st |$InputStream|) (eofval *read-place-holder*)) (read st nil eofval)) (defun |read-line| (st &optional (eofval *read-place-holder*)) (read-line st nil eofval)) |