aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-02-16 14:32:26 +0000
committerdos-reis <gdr@axiomatics.org>2010-02-16 14:32:26 +0000
commit36563244081c887f2f68eea73c5088674f7d8f37 (patch)
tree1983791f9fdcfbc98572e2a0c2e887d3f7fe2489 /src/interp
parent2500d294739cab36d600fc911c91579d3402a4d9 (diff)
downloadopen-axiom-36563244081c887f2f68eea73c5088674f7d8f37.tar.gz
* interp/compiler.boot (compAtomWithModemap): Rewrite.
(transImplementation): Remove.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/compiler.boot24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 1c5808d4..a580dcaf 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -380,26 +380,16 @@ compExpression(x,m,e) ==
FUNCALL(fn,x,m,e)
compForm(x,m,e)
-++ Subroutine of compAtomWithModemap.
-++ Record a local reference to an overload constant, and return
-++ corresponding middle-end form.
-transImplementation: (%Form,%Modemap) -> %Code
-transImplementation(op,map) ==
- fn := genDeltaEntry [op,:map]
- fn is ["XLAM",:.] => [fn]
- ["call",fn]
-
++ Subroutine of compAtom.
++ Elaborate use of an overloaded constant.
compAtomWithModemap: (%Symbol,%Mode,%Env,%List) -> %Maybe %Triple
-compAtomWithModemap(x,m,e,v) ==
- Tl :=
- [[transImplementation(x,map),target,e]
- for map in v | map is [[.,target],[.,fn]]] =>
- --accept only monadic operators
- T:= or/[t for (t:= [.,target,.]) in Tl | modeEqual(m,target)] => T
- 1=#(Tl:= [y for t in Tl | (y:= convert(t,m))]) => first Tl
- nil
+compAtomWithModemap(x,m,e,mmList) ==
+ -- 1. Get out of here f `x' cannot possibly be a constant.
+ null mmList => nil
+ -- FIXME: Reject niladic functions that are used as constants.
+ -- 2. If the context is not specified, give up on ambigiuity.
+ $compUniquelyIfTrue: local := m = $EmptyMode or m = $NoValueMode
+ CATCH("compUniquely", compForm3([x],m,e,mmList))
compAtom(x,m,e) ==
x = "break" => compBreak(x,m,e)