aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure20
-rw-r--r--configure.ac2
-rw-r--r--src/ChangeLog13
-rw-r--r--src/interp/i-toplev.boot5
-rw-r--r--src/interp/int-top.boot28
-rw-r--r--src/interp/setvars.boot15
-rw-r--r--src/interp/sys-driver.boot27
7 files changed, 67 insertions, 43 deletions
diff --git a/configure b/configure
index b35db3a9..912fc709 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for OpenAxiom 1.4.0-2010-11-29.
+# Generated by GNU Autoconf 2.65 for OpenAxiom 1.4.0-2010-11-30.
#
# Report bugs to <open-axiom-bugs@lists.sf.net>.
#
@@ -701,8 +701,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='OpenAxiom'
PACKAGE_TARNAME='openaxiom'
-PACKAGE_VERSION='1.4.0-2010-11-29'
-PACKAGE_STRING='OpenAxiom 1.4.0-2010-11-29'
+PACKAGE_VERSION='1.4.0-2010-11-30'
+PACKAGE_STRING='OpenAxiom 1.4.0-2010-11-30'
PACKAGE_BUGREPORT='open-axiom-bugs@lists.sf.net'
PACKAGE_URL=''
@@ -1491,7 +1491,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.4.0-2010-11-29 to adapt to many kinds of systems.
+\`configure' configures OpenAxiom 1.4.0-2010-11-30 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1566,7 +1566,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OpenAxiom 1.4.0-2010-11-29:";;
+ short | recursive ) echo "Configuration of OpenAxiom 1.4.0-2010-11-30:";;
esac
cat <<\_ACEOF
@@ -1677,7 +1677,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OpenAxiom configure 1.4.0-2010-11-29
+OpenAxiom configure 1.4.0-2010-11-30
generated by GNU Autoconf 2.65
Copyright (C) 2009 Free Software Foundation, Inc.
@@ -2569,7 +2569,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.4.0-2010-11-29, which was
+It was created by OpenAxiom $as_me 1.4.0-2010-11-30, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@
@@ -5468,7 +5468,7 @@ fi
# Define the identity of the package.
PACKAGE='openaxiom'
- VERSION='1.4.0-2010-11-29'
+ VERSION='1.4.0-2010-11-30'
cat >>confdefs.h <<_ACEOF
@@ -20961,7 +20961,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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.4.0-2010-11-29, which was
+This file was extended by OpenAxiom $as_me 1.4.0-2010-11-30, which was
generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21027,7 +21027,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-OpenAxiom config.status 1.4.0-2010-11-29
+OpenAxiom config.status 1.4.0-2010-11-30
configured by $0, generated by GNU Autoconf 2.65,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index e9d7a583..c2438b99 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,7 +33,7 @@ dnl Makefiles for building OpenAxiom interpreter, compiler, libraries, and
dnl auxiliary tools where appropriate.
dnl
-AC_INIT([OpenAxiom], [1.4.0-2010-11-29],
+AC_INIT([OpenAxiom], [1.4.0-2010-11-30],
[open-axiom-bugs@lists.sf.net])
dnl Most of the macros used in this configure.ac are defined in files
diff --git a/src/ChangeLog b/src/ChangeLog
index b106343c..29431495 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-30 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ Fix SF/2110371
+ * interp/i-toplev.boot (recordAndPrint): Tidy.
+ (SpadInterpretFile): Move to int-top.boot.
+ * interp/int-top.boot (ncINTERPFILE): Simplify.
+ (ncloopPrintLines): Output onto the standard output stream.
+ (ncloopIncFileName): Issue diagnostic on error output stream.
+ * interp/setvars.boot (setOutputAlgebra): Fix thinko.
+ (setStandardOutputToAlgebraStream): New.
+ * interp/sys-driver.boot (executeSpadScript): Use it.
+ Set verbosity level as appropriate. Redirect output if requested.
+
2010-11-29 Gabriel Dos Reis <gdr@cs.tamu.edu>
* etc/Makefile.in: Use the driver.
diff --git a/src/interp/i-toplev.boot b/src/interp/i-toplev.boot
index 416537f3..09f12bed 100644
--- a/src/interp/i-toplev.boot
+++ b/src/interp/i-toplev.boot
@@ -196,7 +196,7 @@ recordAndPrint(x,md) ==
mode:= (md=$EmptyMode => quadSch(); md)
if (md ~= $Void) or $printVoidIfTrue then
newlineIfDisplaying()
- if $QuietCommand = false then
+ if not $QuietCommand then
output(x',md')
putHist('%,'value,objNewWrap(x,md),$e)
if $printTimeIfTrue or $printTypeIfTrue then printTypeAndTime(x',md')
@@ -331,9 +331,6 @@ intProcessSynonyms str ==
intInterpretPform pf ==
processInteractive(zeroOneTran packageTran pf2Sex pf, pf)
-SpadInterpretFile fn ==
- SpadInterpretStream(1, fn, nil)
-
intNewFloat() ==
["Float"]
diff --git a/src/interp/int-top.boot b/src/interp/int-top.boot
index 90455fae..a200fc17 100644
--- a/src/interp/int-top.boot
+++ b/src/interp/int-top.boot
@@ -44,14 +44,9 @@ ncParseFromString s ==
zeroOneTran packageTran CATCH($SpadReaderTag, parseFromString s)
ncINTERPFILE(file, echo) ==
- savedEcho := $EchoLines
- savedReadingFile := $ReadingFile
- $EchoLines: fluid := echo
- $ReadingFile: fluid := true
- result := SpadInterpretFile file
- $EchoLines := savedEcho
- $ReadingFile := savedReadingFile
- result
+ $EchoLines: local := echo
+ $ReadingFile: local := true
+ SpadInterpretFile file
ncGetFunction(op, dom, sig) ==
applyInPackage(function getNCfunction,_
@@ -150,6 +145,9 @@ SpadInterpretStream(str, source, interactive?) ==
-----------------------------------------------------------------
+SpadInterpretFile fn ==
+ SpadInterpretStream(1, fn, nil)
+
intloopReadConsole(b, n)==
a:= serverReadLine $InputStream
not string? a => leaveScratchpad()
@@ -324,15 +322,15 @@ streamChop(n,s)==
[[d,:a],b]
ncloopPrintLines lines ==
- for line in lines repeat writeLine rest line
- writeLine '" "
+ for line in lines repeat writeLine(rest line,$OutputStream)
+ writeLine('" ",$OutputStream)
ncloopIncFileName string==
- fn := incFileName string
- not fn =>
- writeLine (strconc(string, '" not found"))
- []
- fn
+ fn := incFileName string
+ not fn =>
+ writeLine(strconc(string, '" not found"),$ErrorStream)
+ []
+ fn
ncloopParse s==
[dq,stream]:=first s
diff --git a/src/interp/setvars.boot b/src/interp/setvars.boot
index 2fced3b3..ed8423ab 100644
--- a/src/interp/setvars.boot
+++ b/src/interp/setvars.boot
@@ -987,10 +987,11 @@ setOutputAlgebra arg ==
-- try to figure out what the argument is
- if arg is [fn] and
- fn in '(Y N YE YES NO O ON OF OFF CONSOLE y n ye yes no o on of off console)
- then 'ok
- else arg := [fn,'spout]
+ if arg is [fn] then
+ arg :=
+ fn in '(Y N YE YES NO O ON OF OFF CONSOLE
+ y n ye yes no o on of off console) => arg
+ [fn,'spout]
arg is [fn] =>
UPCASE(fn) in '(Y N YE O OF) =>
@@ -1048,6 +1049,12 @@ describeSetOutputAlgebra() ==
'"The current setting is: ",'%b,setOutputAlgebra "%display%",'%d]
+++ In case we are catching the output, we are also interested in
+++ redirecting traffic on the standard output to that capturing stream.
+setStandardOutputToAlgebraStream() ==
+ $OutputStream := $algebraOutputStream
+
+
-- See the subsection output characters in setvart.boot
--
-- -------------------- The characters Option --------------------
diff --git a/src/interp/sys-driver.boot b/src/interp/sys-driver.boot
index fa76a020..f450e397 100644
--- a/src/interp/sys-driver.boot
+++ b/src/interp/sys-driver.boot
@@ -246,17 +246,26 @@ initializeGlobalState() ==
++ execute Spad script
executeSpadScript(progname,options,file) ==
- $displayStartMsgs := false
+ -- By default, we want script execution to be as quiet as possible.
+ $displayStartMsgs: local := false
+ -- $ProcessInteractiveValue: local := true
+ $verbose: local := false
initializeGlobalState()
- if $verbose then
- $options := []
- $ProcessInteractiveValue := false
- else
- $options := [["quiet"]]
- $ProcessInteractiveValue := true
- $PrintCompilerMessageIfTrue := $verbose
+ outfile := getOptionValue "output"
+ talkative := outfile or $verbose
+ setOutputAlgebra [(talkative => 'on; 'off)]
+ -- FIXME: redirect standard output to null if not talkative
+ $printVoidIfTrue: local := talkative
+ $printTypeIfTrue: local := talkative
+ $options :=
+ talkative => []
+ [["quiet"]]
+ $PrintCompilerMessageIfTrue: local := talkative
+ if outfile ~= nil then
+ setOutputAlgebra [outfile]
+ setStandardOutputToAlgebraStream()
CATCH($intCoerceFailure,
- CATCH($SpadReaderTag,read [file]))
+ CATCH($SpadReaderTag,read [file]))
coreQuit (errorCount()> 0 => 1; 0)
associateRequestWithFileType(Option '"script", '"input",