aboutsummaryrefslogtreecommitdiff
path: root/src/interp/apply.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-02-02 18:29:40 +0000
committerdos-reis <gdr@axiomatics.org>2008-02-02 18:29:40 +0000
commit98246580bde4dcf9c5dcbf58f3e882bf7f969ddd (patch)
treedca6300171ca56d5ff567a6e1f9df480a440d249 /src/interp/apply.boot
parent82a303c752601bf7bae50a4a919380cfd1872e96 (diff)
downloadopen-axiom-98246580bde4dcf9c5dcbf58f3e882bf7f969ddd.tar.gz
Diffstat (limited to 'src/interp/apply.boot')
-rw-r--r--src/interp/apply.boot17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/interp/apply.boot b/src/interp/apply.boot
index 1faf163b..f1000b5b 100644
--- a/src/interp/apply.boot
+++ b/src/interp/apply.boot
@@ -35,8 +35,7 @@
import '"compiler"
)package "BOOT"
-oldCompilerAutoloadOnceTrigger() == nil
-
+compAtomWithModemap: (%Thing,%Thing,%List,%Thing) -> %List
compAtomWithModemap(x,m,e,v) ==
Tl :=
[[transImplementation(x,map,fn),target,e]
@@ -47,12 +46,13 @@ compAtomWithModemap(x,m,e,v) ==
0<#Tl and m=$NoValueMode => first Tl
nil
+transImplementation: (%Thing,%Thing,%Thing) -> %List
transImplementation(op,map,fn) ==
---+
fn := genDeltaEntry [op,:map]
fn is ["XLAM",:.] => [fn]
["call",fn]
+compApply: (%List,%List,%Thing,%List,%Thing,%List) -> %List
compApply(sig,varl,body,argl,m,e) ==
argTl:= [[.,.,e]:= comp(x,$EmptyMode,e) for x in argl]
contour:=
@@ -63,12 +63,14 @@ compApply(sig,varl,body,argl,m,e) ==
body':= (comp(body,m',addContour(contour,e))).expr
[code,m',e]
+compToApply: (%Thing,%List,%Thing,%List) -> %List
compToApply(op,argl,m,e) ==
T:= compNoStacking(op,$EmptyMode,e) or return nil
m1:= T.mode
T.expr is ["QUOTE", =m1] => nil
compApplication(op,argl,m,T.env,T)
+compApplication: (%Thing,%List,%Thing,%List,%List) -> %List
compApplication(op,argl,m,e,T) ==
T.mode is ['Mapping, retm, :argml] =>
#argl ^= #argml => nil
@@ -90,6 +92,7 @@ compApplication(op,argl,m,e,T) ==
eltForm := ['elt, op, :argl]
comp(eltForm, m, e)
+compFormWithModemap: (%List,%Thing,%List,%List) -> %List
compFormWithModemap(form is [op,:argl],m,e,modemap) ==
[map:= [.,target,:.],[pred,impl]]:= modemap
-- this fails if the subsuming modemap is conditional
@@ -153,6 +156,7 @@ compFormWithModemap(form is [op,:argl],m,e,modemap) ==
-- pairlis:= [[v,:a] for a in argl' for v in $FormalMapVariableList]
-- convert([form,SUBLIS(pairlis,first ml),e],m)
+applyMapping: (%List,%Thing,%List,%List) -> %List
applyMapping([op,:argl],m,e,ml) ==
#argl^=#ml-1 => nil
isCategoryForm(first ml,e) =>
@@ -182,6 +186,7 @@ applyMapping([op,:argl],m,e,ml) ==
--% APPLY MODEMAPS
+compApplyModemap: (%List,%List,%List,%List) -> %List
compApplyModemap(form,modemap,$e,sl) ==
[op,:argl] := form --form to be compiled
[[mc,mr,:margl],:fnsel] := modemap --modemap we are testing
@@ -224,13 +229,16 @@ compApplyModemap(form,modemap,$e,sl) ==
[genDeltaEntry [op,:modemap],lt',$bindings]
[f,lt',$bindings]
+compMapCond: (%List,%Thing,%List,%List) -> %List
compMapCond(op,mc,$bindings,fnsel) ==
or/[compMapCond'(u,op,mc,$bindings) for u in fnsel]
+compMapCond': (%List,%Thing,%Thing,%Thing) -> %List
compMapCond'([cexpr,fnexpr],op,dc,bindings) ==
compMapCond''(cexpr,dc) => compMapCondFun(fnexpr,op,dc,bindings)
stackMessage ["not known that",'%b,dc,'%d,"has",'%b,cexpr,'%d]
+compMapCond'': (%Thing,%Thing) -> %Boolean
compMapCond''(cexpr,dc) ==
cexpr=true => true
--cexpr = "true" => true
@@ -248,5 +256,6 @@ compMapCond''(cexpr,dc) ==
stackMessage ["not known that",'%b,dc,'%d,"has",'%b,cexpr,'%d]
false
-compMapCondFun(fnexpr,op,dc,bindings) == [fnexpr,bindings]
+compMapCondFun(fnexpr,op,dc,bindings) ==
+ [fnexpr,bindings]