aboutsummaryrefslogtreecommitdiff
path: root/src/interp/g-util.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-10-28 10:43:54 +0000
committerdos-reis <gdr@axiomatics.org>2007-10-28 10:43:54 +0000
commit7b0b25d63ed483cc9ccd9525b5904feda65dc807 (patch)
treefd2d98a0ead1cd14865a6e065bcefb93775de970 /src/interp/g-util.boot
parent471d0186fa938e05f69b26dd209544de721de94d (diff)
downloadopen-axiom-7b0b25d63ed483cc9ccd9525b5904feda65dc807.tar.gz
* Makefile.pamphlet (category.$(FASLEXT)): New rule.
(<<category.clisp>>): Remove. * category.boot.pamphlet: Push into package "BOOT". Replace ASSOC with assoc throughout. (mkCategory): Fix syntax. * i-coerce.boot.pamphlet (stripUnionTags): Move to g-util.boot. (isTaggeUnion): Likewise. (getUnionOrRecordTags): Likewise. * i-util.boot.pamphlet (wrap): Move to i-object.boot. (isWrapped): Likewise. (unwrap): Likewise. (wrapped2Quote): Likewise. (quote2Wrapped): Likewise. (removeQuote): Likewise. (TruthP): Move to g-util.boot.
Diffstat (limited to 'src/interp/g-util.boot')
-rw-r--r--src/interp/g-util.boot22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 5908287c..128e683b 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -51,6 +51,28 @@ PPtoFile(x, fname) ==
-- Convert an arbitrary lisp object to canonical boolean.
bool x ==
NULL NULL x
+
+TruthP x ==
+ --True if x is a predicate that's always true
+ x is nil => nil
+ x=true => true
+ x is ['QUOTE,:.] => true
+ nil
+
+--% Record and Union utils.
+
+stripUnionTags doms ==
+ [if dom is [":",.,dom'] then dom' else dom for dom in doms]
+
+isTaggedUnion u ==
+ u is ['Union,:tl] and tl and first tl is [":",.,.] and true
+
+getUnionOrRecordTags u ==
+ tags := nil
+ if u is ['Union, :tl] or u is ['Record, :tl] then
+ for t in tl repeat
+ if t is [":",tag,.] then tags := cons(tag, tags)
+ tags
--% Various lispy things