From e1ae4b73abdbbfe03c47f728de05e0aabbedb291 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 12 Aug 2011 00:43:54 +0000 Subject: * interp/define.boot (NRTgetLookupFunction): Handle the case where the base domain is a parameter. * interp/g-util.boot (formalVarNumber): New. * lisp/core.lisp.in (readIntegerIfCan): Likewise. --- src/interp/define.boot | 9 +++++++-- src/interp/g-util.boot | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src/interp') diff --git a/src/interp/define.boot b/src/interp/define.boot index c854eb27..8df914ac 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -270,10 +270,15 @@ hasDefaultPackage catname == -- Compute the lookup function (complete or incomplete) --======================================================================= NRTgetLookupFunction(domform,exCategory,addForm,env) == + $why: local := nil domform := applySubst($pairlis,domform) + addForm isnt [.,:.] => + IDENTP addForm and (m := getmode(addForm,env)) ~= nil + and isCategoryForm(m,env) + and extendsCategory(domform,exCategory,applySubst($pairlis,m),env) => + 'lookupIncomplete + 'lookupComplete addForm := applySubst($pairlis,addForm) - $why: local := nil - addForm isnt [.,:.] => 'lookupComplete NRTextendsCategory1(domform,exCategory,getExportCategory addForm,env) => 'lookupIncomplete [u,msg,:v] := $why diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index f6584a37..dc663fa7 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -94,7 +94,13 @@ homogeneousListToVector(t,l) == ++ tests if x is an identifier beginning with # isSharpVar x == ident? x and stringChar(symbolName x,0) = char "#" - + +++ If `x' is a formal variable, return its numeral position. +++ Otherwise return nil. +formalVarNumber x == + not isSharpVar x => nil + readIntegerIfCan subsString(symbolName x,1) + isSharpVarWithNum x == not isSharpVar x => nil p := symbolName x -- cgit v1.2.3