aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-06-02 03:28:11 +0000
committerdos-reis <gdr@axiomatics.org>2013-06-02 03:28:11 +0000
commitc3af9dc192b5fa2ced867c777dcaa4c09cfa48ad (patch)
tree39ee0c06db9e02864c0a41f92bca512f2fbd39c2 /src/interp
parent119769a5f0b38d1efff362124141b6533d200e27 (diff)
downloadopen-axiom-c3af9dc192b5fa2ced867c777dcaa4c09cfa48ad.tar.gz
tidy addInformation
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/define.boot20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/interp/define.boot b/src/interp/define.boot
index d15c4682..9063a911 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -139,7 +139,6 @@ formatInfo(u,e) ==
u is ["SIGNATURE",:v] => ["SIGNATURE","$",:v]
u is ["PROGN",:l] => ["PROGN",:[formatInfo(v,e) for v in l]]
u is ["ATTRIBUTE",v] =>
-
-- The parser can't tell between those attributes that really
-- are attributes, and those that are category names
v isnt [.,:.] and isCategoryForm([v],e) => ["has","$",[v]]
@@ -155,20 +154,19 @@ formatInfo(u,e) ==
liftCond [["not",formatPred(a,e)],formatInfo(c,e)]]
systemError ['"formatInfo",u]
-addInfo(u,e) ==
- $Information:= [formatInfo(u,e),:$Information]
-
addInformation(m,e) ==
- $Information: local := nil
- info(m,e) where
- info(m,e) ==
- --Processes information from a mode declaration in compCapsule
+ facts := ref nil -- list of facts to derive from `m'.
+ deduce(m,facts,e) where
+ deduce(m,facts,e) ==
m isnt [.,:.] => nil
- m is ["CATEGORY",.,:stuff] => for u in stuff repeat addInfo(u,e)
- m is ["Join",:stuff] => for u in stuff repeat info(u,e)
+ m is ["CATEGORY",.,:stuff] =>
+ for u in stuff repeat
+ deref(facts) := [formatInfo(u,e),:deref facts]
+ m is ["Join",:stuff] =>
+ for u in stuff repeat deduce(u,facts,e)
nil
put("$Information","special",
- [:$Information,:get("$Information","special",e)],e)
+ [:deref facts,:get("$Information","special",e)],e)
hasToInfo (pred is ["has",a,b]) ==
b is ["SIGNATURE",:data] => ["SIGNATURE",a,:data]