From 5b693510bb2368f453b71086fcd1916cee7fea82 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Mon, 24 Nov 2008 02:53:25 +0000 Subject: * interp/i-output.boot ($RecordSeparator): New. (maprin): Use it. Separate record in lean mode. * interp/sys-globals.boot ($leanMode): Define. * interp/sys-driver.boot (systemMain): Initialize. * interp/ht-util.boot (executeInterpreterCommand): Print prompt only in non-lean mode. * interp/int-top.boot (SpadInterpretStream): Likewise. (intloopReadConsole): Likewise. * interp/metalex.lisp (get-a-line): Likewise. * interp/server.boot: Likewise. --- src/ChangeLog | 13 +++++++++++++ src/interp/ht-util.boot | 2 +- src/interp/i-output.boot | 6 ++++++ src/interp/int-top.boot | 8 ++++---- src/interp/metalex.lisp | 3 ++- src/interp/server.boot | 8 ++++---- src/interp/sys-driver.boot | 4 +++- src/interp/sys-globals.boot | 3 +++ 8 files changed, 36 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index d1f605e7..92225468 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2008-11-23 Gabriel Dos Reis + + * interp/i-output.boot ($RecordSeparator): New. + (maprin): Use it. Separate record in lean mode. + * interp/sys-globals.boot ($leanMode): Define. + * interp/sys-driver.boot (systemMain): Initialize. + * interp/ht-util.boot (executeInterpreterCommand): Print prompt + only in non-lean mode. + * interp/int-top.boot (SpadInterpretStream): Likewise. + (intloopReadConsole): Likewise. + * interp/metalex.lisp (get-a-line): Likewise. + * interp/server.boot: Likewise. + 2008-11-23 Gabriel Dos Reis * lib/cfuns-c.c (oa_copy_file): Specify permission mode for the diff --git a/src/interp/ht-util.boot b/src/interp/ht-util.boot index 21d78e58..ab6f8db8 100644 --- a/src/interp/ht-util.boot +++ b/src/interp/ht-util.boot @@ -474,7 +474,7 @@ executeInterpreterCommand command == TERPRI() ncSetCurrentLine(command) CATCH($SpadReaderTag, parseAndInterpret command) - printPrompt "andFlush" + not $leanMode and printPrompt "andFlush" typeCheckInputAreas htPage == -- This needs to be severly beefed up diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot index 4d4841a1..806aa8a7 100644 --- a/src/interp/i-output.boot +++ b/src/interp/i-output.boot @@ -164,6 +164,10 @@ $plainRTspecialCharacters == [ '_\ -- back slash ] +++ End of Transmission character; usually to the Algebra Output +++ Stream in lean mode. +$RecordSeparator == CODE_-CHAR 30 + makeCharacter n ==> INTERN(STRING(CODE_-CHAR n)) $RTspecialCharacters == [ @@ -1122,6 +1126,8 @@ maprinSpecial(x,$MARGIN,$LINELENGTH) == maprin0 x maprin x == if $demoFlag=true then recordOrCompareDemoResult x CATCH('output,maprin0 x) + $leanMode and + WRITE($RecordSeparator,KEYWORD::STREAM,$algebraOutputStream) nil maprin0 x == diff --git a/src/interp/int-top.boot b/src/interp/int-top.boot index 17c08196..8c7df1e8 100644 --- a/src/interp/int-top.boot +++ b/src/interp/int-top.boot @@ -134,7 +134,7 @@ SpadInterpretStream(str, source, interactive?) == $promptMsg : local := 'S2CTP023 interactive? => - printPrompt() + not $leanMode and printPrompt() intloopReadConsole('"", str) [] intloopInclude (source,0) @@ -146,19 +146,19 @@ intloopReadConsole(b, n)== a:= serverReadLine $InputStream not STRINGP a => leaveScratchpad() #a=0 => - printPrompt() + not $leanMode and printPrompt() intloopReadConsole('"", n) pfx := stripSpaces intloopPrefix?('")fi",a) pfx and ((pfx = '")fi") or (pfx = '")fin")) => [] b = '"" and (d := intloopPrefix?('")", a)) => setCurrentLine d c := ncloopCommand(d,n) - printPrompt() + not $leanMode and printPrompt() intloopReadConsole('"", c) a:=CONCAT(b,a) ncloopEscaped a => intloopReadConsole(SUBSEQ(a, 0, (LENGTH a) - 1),n) c := intloopProcessString(a, n) - printPrompt() + not $leanMode and printPrompt() intloopReadConsole('"", c) intloopPrefix?(prefix,whole) == diff --git a/src/interp/metalex.lisp b/src/interp/metalex.lisp index 8583158a..2c1dd294 100644 --- a/src/interp/metalex.lisp +++ b/src/interp/metalex.lisp @@ -179,7 +179,8 @@ :adjustable t :initial-contents s)))) (defun get-a-line (stream) - (if (IS-CONSOLE stream) (|printPrompt|)) + (if (and (IS-CONSOLE stream) (not |$leanMode|)) + (|printPrompt|)) (let ((ll (read-a-line stream))) (if (stringp ll) (make-string-adjustable ll) ll))) diff --git a/src/interp/server.boot b/src/interp/server.boot index 6e0ee514..9c37a0d2 100644 --- a/src/interp/server.boot +++ b/src/interp/server.boot @@ -90,7 +90,7 @@ serverReadLine(stream) == stringBuf := sockGetString $MenuServer CATCH('coerceFailure,CATCH($intTopLevel, CATCH($SpadReaderTag, parseAndInterpret stringBuf))) - printPrompt "andFlush" + not $leanMode and printPrompt "andFlush" action = $NonSmanSession => $SpadServer := nil action = $KillLispSystem => @@ -121,13 +121,13 @@ serverLoop() == IN_-STREAM: fluid := $InputStream _*EOF_*: fluid := NIL while not $EndServerSession and not _*EOF_* repeat - if $Prompt then printPrompt "andFlush" + if $Prompt and not $leanMode then printPrompt "andFlush" $Prompt := NIL action := serverSwitch() action = $CallInterp => CATCH('coerceFailure,CATCH($intTopLevel, CATCH($SpadReaderTag, parseAndInterpret read_-line($InputStream) ))) - printPrompt "andFlush" + not $leanMode and printPrompt "andFlush" sockSendInt($SessionManager, $EndOfOutput) action = $CreateFrame => frameName := GENSYM('"frame") @@ -153,7 +153,7 @@ serverLoop() == stringBuf := sockGetString $MenuServer CATCH('coerceFailure,CATCH($intTopLevel, CATCH($SpadReaderTag, parseAndInterpret stringBuf))) - printPrompt "andFlush" + not $leanMode and printPrompt "andFlush" sockSendInt($SessionManager, $EndOfOutput) NIL if _*EOF_* then $Prompt := true diff --git a/src/interp/sys-driver.boot b/src/interp/sys-driver.boot index 9a53ca2f..69d97844 100644 --- a/src/interp/sys-driver.boot +++ b/src/interp/sys-driver.boot @@ -299,6 +299,8 @@ systemMain() == AxiomCore::topLevel() REROOT() -- ??? Make this call unconditional - if $StandardLinking then initializeGlobalState() + if $StandardLinking then + initializeGlobalState() + $leanMode := getOptionValue "mode" = '"lean" %basicSystemIsComplete() => restart() fatalError '"fell off systemMain" diff --git a/src/interp/sys-globals.boot b/src/interp/sys-globals.boot index 5f71143d..c90028e7 100644 --- a/src/interp/sys-globals.boot +++ b/src/interp/sys-globals.boot @@ -492,3 +492,6 @@ $compileExportsOnly := false ++ of category defaults only. This is meaningful only when ++ compiling categories. $compileDefaultsOnly := false + +++ +$leanMode := false -- cgit v1.2.3