aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog14
-rw-r--r--src/interp/clam.boot6
-rw-r--r--src/interp/compiler.boot4
-rw-r--r--src/interp/g-opt.boot2
-rw-r--r--src/interp/lisp-backend.boot4
-rw-r--r--src/interp/slam.boot11
6 files changed, 28 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5b28f673..c5f978c4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,17 @@
+2011-02-03 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * interp/slam.boot (reportFunctionCompilation): Use %otherwise,
+ not %true for default cases.
+ (reportFunctionCacheAll): Likewise.
+ (compileRecurrenceRelation): Likewise.
+ * interp/lisp-backend.boot (expandTry): Tidy.
+ * interp/g-opt.boot ($VMsideEffectFreeOperators): Include %otherwise.
+ * interp/compiler.boot (compAlternativeGuard): Emit %otherwise
+ form, not Lisp level T form.
+ * interp/clam.boot (compClam): Tidy.
+ (compHash): Likewise.
+ (compHashGlobal): Likewise.
+
2011-02-02 Gabriel Dos Reis <gdr@cs.tamu.edu>
* interp/compiler.boot (finishLambdaExpression): Tidy. Don't
diff --git a/src/interp/clam.boot b/src/interp/clam.boot
index 8a50b780..fbce1a6a 100644
--- a/src/interp/clam.boot
+++ b/src/interp/clam.boot
@@ -134,7 +134,7 @@ compClam(op,argl,body,$clamList) ==
countFl => ['%makepair,1,g2]
g2
thirdPredPair:=
- ['%true,
+ ['%otherwise,
['%store,g2,computeValue],
['%store,g3,['%head,cacheName]],
['%store,['%head,g3],g1],
@@ -245,7 +245,7 @@ compHash(op,argl,body,cacheNameOrNil,eqEtc,countFl) ==
if cacheNameOrNil then putCode :=
['UNWIND_-PROTECT,['PROG1,putCode,['%store,g2,'%true]],
['%when,[['%not,g2],['HREM,cacheName,MKQ op]]]]
- thirdPredPair:= ['%true,putCode]
+ thirdPredPair:= ['%otherwise,putCode]
codeBody:=
['PROG,[g2],
:callCountCode,['RETURN,['%when,secondPredPair,thirdPredPair]]]
@@ -303,7 +303,7 @@ compHashGlobal(op,argl,body,cacheName,eqEtc,countFl) ==
putCode:=
countFl => ['HPUT,cacheName,putForm,['%makepair,1,computeValue]]
['HPUT,cacheName,putForm,computeValue]
- thirdPredPair:= ['%true,putCode]
+ thirdPredPair:= ['%otherwise,putCode]
codeBody:= ['PROG,[g2], ['RETURN,['%when,secondPredPair,thirdPredPair]]]
lamex:= ['LAM,arg,codeBody]
mainFunction:= [op,lamex]
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index a222dd37..01e04e22 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -2155,7 +2155,7 @@ compAlternativeGuard(sn,sm,pat,e) ==
if $catchAllCount > 0 then
warnTooManyOtherwise()
$catchAllCount := $catchAllCount + 1
- [true,nil,e,e]
+ ['%otherwise,nil,e,e]
cons? sn =>
pat isnt ["%Comma",:.] =>
stackAndThrow('"Pattern must be a tuple for a tuple scrutinee",nil)
@@ -2170,7 +2170,7 @@ compAlternativeGuard(sn,sm,pat,e) ==
guards := [guard,:guards]
inits := [init,:inits]
ok := false
- ok => [["AND",:nreverse guards],append/nreverse inits,e,originalEnv]
+ ok => [['%and,:nreverse guards],append/nreverse inits,e,originalEnv]
nil
compAlternativeGuardItem(sn,sm,pat,e)
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 4806b103..b02b81b3 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -401,7 +401,7 @@ $VMsideEffectFreeOperators ==
QEQCAR QCDR QCAR IDENTP
FLOAT_-RADIX FLOAT FLOAT_-SIGN
CGREATERP GGREATERP CHAR GET BVEC_-GREATER %when %false %true
- %2bit %2bool
+ %otherwise %2bit %2bool
%and %or %not %peq %ieq %ilt %ile %igt %ige %head %tail %integer?
%beq %blt %ble %bgt %bge %bitand %bitior %bitnot %bcompl %ilength
%ibit %icst0 %icst1
diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot
index 64d2e82e..af3e246b 100644
--- a/src/interp/lisp-backend.boot
+++ b/src/interp/lisp-backend.boot
@@ -380,11 +380,11 @@ expandTry ['%try,expr,handlers,cleanup] ==
for [.,var,mode,stmt] in handlers]
handlerBody :=
ys = nil => g
- ys := [:ys,['%true,['THROW,$OpenAxiomCatchTag,g]]]
+ ys := [:ys,['%otherwise,['THROW,$OpenAxiomCatchTag,g]]]
['%when,
[['%and,['%pair?,g],
['%peq,['%head,g],$OpenAxiomCatchTag]], ['%when,:ys]],
- ['%true,g]]
+ ['%otherwise,g]]
tryBlock := expandBind
['%bind,[[g,['CATCH,$OpenAxiomCatchTag,expr]]],handlerBody]
cleanup = nil => tryBlock
diff --git a/src/interp/slam.boot b/src/interp/slam.boot
index dfea7745..7bc05b3b 100644
--- a/src/interp/slam.boot
+++ b/src/interp/slam.boot
@@ -175,8 +175,9 @@ reportFunctionCompilation(op,nam,argl,body,isRecursive) ==
null argl => [cacheName]
[["%store",g3,['assocCircular,g1,["%dynval",MKQ cacheName]]],['CDR,g3]]
thirdPredPair:=
- null argl => ['%true,[['%store,['%dynval,MKQ cacheName],computeValue]]]
- ['%true,
+ null argl =>
+ ['%otherwise,[['%store,['%dynval,MKQ cacheName],computeValue]]]
+ ['%otherwise,
['%store,g2,computeValue],
["SETQ",g3,
["CAR",["%store",["%dynval",MKQ cacheName],['predCircular,["%dynval",cacheName],cacheCount]]]],
@@ -218,7 +219,7 @@ reportFunctionCacheAll(op,nam,argl,body) ==
cacheName:= mkCacheName nam
g2:= gensym() --value computed by calling function
secondPredPair:= [['%store,g2,["HGET",['%dynval,MKQ cacheName],g1]],g2]
- thirdPredPair:= ['%true,["HPUT",['%dynval,MKQ cacheName],g1,computeValue]]
+ thirdPredPair:= ['%otherwise,["HPUT",['%dynval,MKQ cacheName],g1,computeValue]]
codeBody:= ["PROG",[g2],["RETURN",['%when,secondPredPair,thirdPredPair]]]
lamex:= ["LAM",arg,codeBody]
mainFunction:= [nam,lamex]
@@ -316,7 +317,7 @@ compileRecurrenceRelation(op,nam,argl,junk,[body,sharpArg,n,:initCode]) ==
['%when,[['%not,['%and,["BOUNDP",MKQ stateNam], _
['%pair?,['%dynval,MKQ stateNam]]]], _
["%LET",stateVar,cacheResetCode]], _
- ['%true, ["%LET",stateVar,['%dynval,MKQ stateNam]]]]
+ ['%otherwise, ["%LET",stateVar,['%dynval,MKQ stateNam]]]]
-- when there are extra arguments, initialResetCode resets "stateVar"
-- to the hashtable entry for the extra arguments
@@ -335,7 +336,7 @@ compileRecurrenceRelation(op,nam,argl,junk,[body,sharpArg,n,:initCode]) ==
phrase3:= [['%igt,sharpArg,n],[auxfn,:argl,['%listlit,n,:initCode]]]
phrase4:= [['%igt,sharpArg,n-k],
["ELT",['%listlit,:initCode],["QSDIFFERENCE",n,sharpArg]]]
- phrase5:= ['%true,['recurrenceError,MKQ op,sharpArg]]
+ phrase5:= ['%otherwise,['recurrenceError,MKQ op,sharpArg]]
['PROGN,:preset,['%when,phrase1,phrase2,phrase3,phrase4,phrase5]]
if $verbose then
sayKeyedMsg("S2IX0001",[op])