aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-05-11 03:28:45 +0000
committerdos-reis <gdr@axiomatics.org>2008-05-11 03:28:45 +0000
commit51422a0c6bc0128cd5635a01c402ef56ad4ed770 (patch)
treed7f4cb13310b177e1691acd1307eb420d70b2546 /src/interp
parentd2412069e4fc43a4bc6cc28ce4c57e02f8baee41 (diff)
downloadopen-axiom-51422a0c6bc0128cd5635a01c402ef56ad4ed770.tar.gz
* interp/iterator.boot (compRepeatOrCollect): Don't iterator
variables and variables declared in a loop are local to that loop. * interp/g-error.boot (needsToSplitMessage): New. (errorSupervisor): Use it. * interp/compiler.boot (compSymbol): Highlight erron=eous symbol. * interp/wi1.boot (stackMessage): Remove duplicate. * algebra/ffcat.spad.pamphlet (FiniteFieldCategory): Tidy. * algebra/fff.spad.pamphlet (FiniteFieldFunctions): Likewie. * algebra/groebsol.spad.pamphlet (GroebnerSolve): Likewise. * algebra/intfact.spad.pamphlet (IntegerRoots): Likewise. * algebra/mkfunc.spad.pamphlet (InputForm): Likewise. * algebra/numtheor.spad.pamphlet (IntegerNumberTheoryFunctions): Likewise. * algebra/permgrps.spad.pamphlet (PermutationGroup): Likewise. * algebra/random.spad.pamphlet (RandomFloatDistributions): Likewise. * algebra/sgcf.spad.pamphlet (SymmetricGroupCombinatoricFunctions): Likewise. * algebra/triset.spad.pamphlet (PolynomialSetUtilitiesPackage): Likewise. * algebra/twofact.spad.pamphlet (TwoFactorize): Likewise.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/compiler.boot2
-rw-r--r--src/interp/g-error.boot21
-rw-r--r--src/interp/iterator.boot5
-rw-r--r--src/interp/wi1.boot5
4 files changed, 18 insertions, 15 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 0a8162d3..b120fc9d 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -333,7 +333,7 @@ compSymbol(s,m,e) ==
not isFunction(s,e) and null ($compForModeIfTrue=true) then errorRef s
[s,m',e] --s is a declared argument
MEMQ(s,$FormalMapVariableList) =>
- stackMessage('"no mode found for %1",[s])
+ stackMessage('"no mode found for %1b",[s])
m = $OutputForm or m = $Symbol => [['QUOTE,s],m,e]
not isFunction(s,e) => errorRef s
diff --git a/src/interp/g-error.boot b/src/interp/g-error.boot
index c3bcdf5a..32ed1d72 100644
--- a/src/interp/g-error.boot
+++ b/src/interp/g-error.boot
@@ -78,6 +78,12 @@ queryUser msg ==
errorSupervisor(errorType,errorMsg) ==
errorSupervisor1(errorType,errorMsg,$BreakMode)
+needsToSplitMessage msg ==
+ member("%b", msg) or member('"%b",msg) => false
+ member("%d",msg) or member('"%d",msg) => false
+ member("%l",msg) or member('"%l",msg) => false
+ true
+
errorSupervisor1(errorType,errorMsg,$BreakMode) ==
BUMPERRORCOUNT "semantic"
errorLabel :=
@@ -90,11 +96,7 @@ errorSupervisor1(errorType,errorMsg,$BreakMode) ==
msg :=
errorMsg is ['mathprint, :.] => errorMsg
not PAIRP errorMsg => ['" ", errorMsg]
- splitmsg := true
- if member('%b,errorMsg) then splitmsg := nil
- else if member('%d,errorMsg) then splitmsg := nil
- else if member('%l,errorMsg) then splitmsg := nil
- splitmsg => CDR [:['%l,'" ",u] for u in errorMsg]
+ needsToSplitMessage errorMsg => rest [:['%l,'" ",u] for u in errorMsg]
['" ",:errorMsg]
sayErrorly(errorLabel, msg)
handleLispBreakLoop($BreakMode)
@@ -170,14 +172,17 @@ sayErrorly1(errorLabel, msg) ==
sayBrightly msg
-- systemError is being phased out. Please use keyedSystemError.
-systemError(:x) == errorSupervisor($SystemError,IFCAR x)
+systemError(:x) ==
+ errorSupervisor($SystemError,IFCAR x)
-- unexpectedSystemError() ==
-- systemError '"Oh, no. Unexpected internal error."
-userError x == errorSupervisor($UserError,x)
+userError x ==
+ errorSupervisor($UserError,x)
-error(x) == errorSupervisor($AlgebraError,x)
+error(x) ==
+ errorSupervisor($AlgebraError,x)
IdentityError(op) ==
error(["No identity element for reduce of empty list using operation",op])
diff --git a/src/interp/iterator.boot b/src/interp/iterator.boot
index 70a52f6d..d62f4939 100644
--- a/src/interp/iterator.boot
+++ b/src/interp/iterator.boot
@@ -132,7 +132,10 @@ compRepeatOrCollect(form,m,e) ==
(u:=modeIsAggregateOf('Vector,targetMode,e)) => CAR u
["Vector",m']
m'
- coerceExit([form',m'',e'],targetMode)
+ T := coerceExit([form',m'',e'],targetMode) or return nil
+ -- iterator variables and other variables declared in
+ -- in a loop are local to the loop.
+ [T.expr,T.mode,e]
--constructByModemap([x,source,e],target) ==
-- u:=
diff --git a/src/interp/wi1.boot b/src/interp/wi1.boot
index 7d327fa4..02f0c892 100644
--- a/src/interp/wi1.boot
+++ b/src/interp/wi1.boot
@@ -56,11 +56,6 @@ tr fn ==
CATCH("SPAD__READER",compiler [INTERN sfn])
SHUT $outStream
-stackMessage msg ==
---if msg isnt ["cannot coerce: ",:.] then foobum msg
- $compErrorMessageStack:= [msg,:$compErrorMessageStack]
- nil
-
ppFull x ==
SETQ(_*PRINT_-LEVEL_*,nil)
SETQ(_*PRINT_-LENGTH_*,nil)