aboutsummaryrefslogtreecommitdiff
path: root/src/boot/ast.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-05-10 22:50:44 +0000
committerdos-reis <gdr@axiomatics.org>2009-05-10 22:50:44 +0000
commitc17f22c0fea71fba2e99aad1e7292be1963ae96d (patch)
treef51301306df7b6a741e9506d1af5abf7512af49e /src/boot/ast.boot
parent76905b59dbaaac8fab4892067e973312fd86dde9 (diff)
downloadopen-axiom-c17f22c0fea71fba2e99aad1e7292be1963ae96d.tar.gz
Cope with SBCL-1.0.28 improvements.
* boot/translator.boot (translateToplevel): Load imported modules. * boot/ast.boot ($constantIdentifiers): New. ($activeNamespace): Likewise. (bfSimpleDefinition): Likewise. (isDynamicVariable): Likewise. (shoeCompTran1): Tidy. Use it. * boot/parser.boot (bpSimpleDefinitionTail): Use bfSimpleDefinition. * boot/Makefile.in (stage1/%.clisp): Specify load directory. (stage2/%.clisp): Likewise. * lisp/core.lisp.in (startCompileDuration): Export. (endCompileDuration): Likewise.
Diffstat (limited to 'src/boot/ast.boot')
-rw-r--r--src/boot/ast.boot39
1 files changed, 34 insertions, 5 deletions
diff --git a/src/boot/ast.boot b/src/boot/ast.boot
index 0e42ac62..b49f149f 100644
--- a/src/boot/ast.boot
+++ b/src/boot/ast.boot
@@ -47,6 +47,14 @@ module ast
++ translated with the obvious semantics, e.g. no caching.
$bfClamming := false
+++ List of identifiers defined as constants in the current
+++ translation unit.
+$constantIdentifiers := nil
+
+++ When non-nil holds the scope nominated in the most recent
+++ namespace definition.
+$activeNamespace := nil
+
--% Basic types used in Boot codes.
%Thing <=> true
@@ -193,7 +201,17 @@ bfColonAppend(x,y) ==
bfDefinition: (%Thing,%Thing,%Thing) -> %List
bfDefinition(bflhsitems, bfrhs,body) ==
['DEF,bflhsitems,bfrhs,body]
+
+bfSimpleDefinition: (%Thing,%Thing) -> %Thing
+bfSimpleDefinition(lhs,rhs) ==
+ if atom lhs then
+ $constantIdentifiers := [lhs,:$constantIdentifiers]
+ else if lhs is ["%Signature",id,.] then
+ $constantIdentifiers := [id,:$constantIdentifiers]
+ ConstantDefinition(lhs,rhs)
+
+
bfMDefinition: (%Thing,%Thing,%Thing) -> %List
bfMDefinition(bflhsitems, bfrhs,body) ==
bfMDef('MDEF,bflhsitems,bfrhs,body)
@@ -946,14 +964,25 @@ shoeATOMs x==
else if atom x
then [x]
else append(shoeATOMs first x,shoeATOMs rest x)
+
+++ Return true if `x' is an identifier name that designates a
+++ dynamic (e.g. Lisp special) variable.
+isDynamicVariable x ==
+ IDENTP x and bfBeginsDollar x =>
+ MEMQ(x,$constantIdentifiers) => false
+ CONSTANTP x => false
+ BOUNDP x or null $activeNamespace => true
+ y := FIND_-SYMBOL(STRING x,$activeNamespace) => not CONSTANTP y
+ true
+ false
shoeCompTran1 x==
atom x=>
- IDENTP x and bfBeginsDollar x=>
- $dollarVars:=
- MEMQ(x,$dollarVars)=>$dollarVars
- cons(x,$dollarVars)
- nil
+ isDynamicVariable x =>
+ $dollarVars:=
+ MEMQ(x,$dollarVars)=>$dollarVars
+ cons(x,$dollarVars)
+ nil
U:=car x
EQ(U,"QUOTE")=>nil
x is ["L%T",l,r]=>