aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/compiler.boot16
-rw-r--r--src/interp/sys-macros.lisp6
2 files changed, 9 insertions, 13 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 004acbb0..cb237c12 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -1895,10 +1895,7 @@ compMapCondFun(fnexpr,op,dc,bindings) ==
--% Interface to the backend
compileFileQuietly path ==
- $OutputStream :=
- $InteractiveMode => MAKE_-BROADCAST_-STREAM()
- MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*"
- COMPILE_-FILE path
+ quietlyIfInteractive COMPILE_-FILE path
compAndDefine l ==
_*COMP370_-APPLY_* := "PRINT-AND-EVAL-DEFUN"
@@ -1910,11 +1907,7 @@ compQuietly fn ==
$compileDontDefineFunctions => "COMPILE-DEFUN"
"EVAL-DEFUN"
"PRINT-DEFUN"
- -- create a null outputstream if $InteractiveMode
- $OutputStream :=
- $InteractiveMode => MAKE_-BROADCAST_-STREAM()
- MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*"
- COMP fn
+ quietlyIfInteractive COMP fn
compileQuietly fn ==
_*COMP370_-APPLY_* :=
@@ -1922,10 +1915,7 @@ compileQuietly fn ==
$compileDontDefineFunctions => "COMPILE-DEFUN"
"EVAL-DEFUN"
"PRINT-DEFUN"
- $OutputStream :=
- $InteractiveMode => MAKE_-BROADCAST_-STREAM()
- MAKE_-SYNONYM_-STREAM "*STANDARD-OUTPUT*"
- COMP370 fn
+ quietlyIfInteractive COMP370 fn
COMP l ==
diff --git a/src/interp/sys-macros.lisp b/src/interp/sys-macros.lisp
index c53dac73..53a6c3b5 100644
--- a/src/interp/sys-macros.lisp
+++ b/src/interp/sys-macros.lisp
@@ -1308,6 +1308,12 @@
(SUBST (SECOND L) 'x
'(COND ($reportFlag (sayBrightly x)) ((QUOTE T) NIL))))
+;; Quietly execute `cmd' if in interactive session
+(defmacro |quietlyIfInteractive| (cmd)
+ `(let ((|$OutputStream| (if |$InteractiveMode|
+ (make-broadcast-stream)
+ (make-synonym-stream '*standard-output*))))
+ ,cmd))
(defmacro |spadConstant| (dollar n)
`(spadcall (svref ,dollar (the fixnum ,n))))