aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-08-12 00:43:54 +0000
committerdos-reis <gdr@axiomatics.org>2011-08-12 00:43:54 +0000
commite1ae4b73abdbbfe03c47f728de05e0aabbedb291 (patch)
tree03d21fc43a94efa0e75f429d465f4a242cd6e844 /src/interp
parenta1de530b8c7a40177f1e8c0ebf84d8e9359ef503 (diff)
downloadopen-axiom-e1ae4b73abdbbfe03c47f728de05e0aabbedb291.tar.gz
* 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.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/define.boot9
-rw-r--r--src/interp/g-util.boot8
2 files changed, 14 insertions, 3 deletions
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