From a4858ca2cb47dcaa229683dda30d167f49b4c3a6 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 25 Oct 2011 22:14:09 +0000 Subject: * interp/compiler.boot (getFormModemaps): Tidy checking of "elt" and "setelt" modemaps. --- src/interp/compiler.boot | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/interp') diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index e0fae8b4..25ab8c1a 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -625,19 +625,18 @@ compFormWithModemap(form,m,e,modemap) == ++ case is made for a modemap whose sole parameter type is a Tuple. ++ In that case, it matches any number of supplied arguments. getFormModemaps(form is [op,:argl],e) == - op is ["elt",domain,op1] => + op is ["elt",domain,op1] and isDomainForm(domain,e) => [x for x in getFormModemaps([op1,:argl],e) | x.mmDC = domain] - cons? op => nil - modemapList:= get(op,"modemap",e) + op is [.,:.] => nil + modemapList := get(op,"modemap",e) -- Within default implementations, modemaps cannot mention the -- current domain. if $insideCategoryPackageIfTrue then modemapList := [x for x in modemapList | x.mmDC isnt '$] - if op is "elt" - then modemapList:= eltModemapFilter(last argl,modemapList,e) or return nil - else - if op is "setelt" then modemapList:= - seteltModemapFilter(second argl,modemapList,e) or return nil + if form is ["elt",.,f] then + modemapList := eltModemapFilter(f,modemapList,e) or return nil + else if form is ["setelt",.,f,.] then + modemapList := seteltModemapFilter(f,modemapList,e) or return nil nargs := #argl finalModemapList:= [mm for mm in modemapList | enoughArguments(argl,mm.mmSource)] -- cgit v1.2.3