From 36563244081c887f2f68eea73c5088674f7d8f37 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 16 Feb 2010 14:32:26 +0000 Subject: * interp/compiler.boot (compAtomWithModemap): Rewrite. (transImplementation): Remove. --- src/interp/compiler.boot | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'src/interp') 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) -- cgit v1.2.3