aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-03-02 10:07:19 +0000
committerdos-reis <gdr@axiomatics.org>2011-03-02 10:07:19 +0000
commitbc50325269c6765b78b8a7f8df0baf96d6dff4e8 (patch)
tree625f7892ecc61ffa2226dcd544f74b0020d49583 /src/interp
parent06a195106936c4ff03dcf23eef9351c007c5e48e (diff)
downloadopen-axiom-bc50325269c6765b78b8a7f8df0baf96d6dff4e8.tar.gz
* interp/i-eval.boot (mkEvalable): Exit early on niladic constructors.
* interp/define.boot (compDefineFunctor1): If bootstrapping, mark functor as incomplete. * interp/c-util.boot (lookupDefiningFunction): Don't look into incomplete domains.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot7
-rw-r--r--src/interp/define.boot4
-rw-r--r--src/interp/i-eval.boot2
3 files changed, 10 insertions, 3 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 8904dddc..8c1fe71b 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1747,8 +1747,11 @@ lookupInheritedDefiningFunction(op,sig,shell,args,slot) ==
++ and that is unambiguous is returned. In particular, this
++ function defaulting packages.
lookupDefiningFunction(op,sig,dc) ==
- -- 1. Read domain information, if available.
+ -- 1. Read domain information, if available. Silently give up if
+ -- the constructor is just not there
[ctor,:args] := dc
+ loadLibIfNotLoaded ctor
+ property(ctor,'%incomplete) => nil
-- 1.1. Niladic constructors don't need approximation.
-- FIXME: However, there may be cylic dependencies
-- such as AN ~> IAN ~> EXPR INT ~> AN that prevents
@@ -1757,8 +1760,6 @@ lookupDefiningFunction(op,sig,dc) ==
compiledLookup(op,sig,dc)
-- 1.2. Don't look into defaulting package
isDefaultPackageName ctor => nil
- -- 1.2. Silently give up if the constructor is just not there
- loadLibIfNotLoaded ctor
infovec := property(ctor,'infovec) or return nil
-- 1.3. We need information about the original domain template
shell := first infovec -- domain template
diff --git a/src/interp/define.boot b/src/interp/define.boot
index b921d206..695a1ac8 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -752,6 +752,10 @@ compDefineFunctor1(df is ['DEF,form,signature,nils,body],
if null argl then
evalAndRwriteLispForm('NILADIC,
['MAKEPROP, ['QUOTE,op'], ['QUOTE,'NILADIC], true])
+ -- Functors are incomplete during bootstrap
+ if $bootStrapMode then
+ evalAndRwriteLispForm('%incomplete,
+ ['MAKEPROP, ['QUOTE,op'], ['QUOTE,'%incomplete], true])
[fun,['Mapping,:signature'],originale]
++ Subroutine of compDefineFunctor1. Called to generate backend code
diff --git a/src/interp/i-eval.boot b/src/interp/i-eval.boot
index ef02faf9..e857253d 100644
--- a/src/interp/i-eval.boot
+++ b/src/interp/i-eval.boot
@@ -55,6 +55,8 @@ mkEvalable form ==
op="Union" => mkEvalableUnion form
op="Mapping"=> mkEvalableMapping form
op="Enumeration" => form
+ -- a niladic constructor instantiation goes by itself
+ constructor? op and argl = nil => form
loadIfNecessary op
kind:= getConstructorKindFromDB op
cosig := getDualSignatureFromDB op =>