aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/syntax.spad
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-12-12 05:18:09 +0000
committerdos-reis <gdr@axiomatics.org>2007-12-12 05:18:09 +0000
commit59c74f79255a713a633fc6b7ca3e18ff89d018b7 (patch)
tree5c5efd8048fe58399dcd84d9d0f19f130e5e949e /src/algebra/syntax.spad
parent0d6564c18ff92a96f98c235b82a0da82556e5098 (diff)
downloadopen-axiom-59c74f79255a713a633fc6b7ca3e18ff89d018b7.tar.gz
* syntax.spad (nil?$Syntax): New predicate.
Diffstat (limited to 'src/algebra/syntax.spad')
-rw-r--r--src/algebra/syntax.spad6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/algebra/syntax.spad b/src/algebra/syntax.spad
index 80bee21e..df62adb5 100644
--- a/src/algebra/syntax.spad
+++ b/src/algebra/syntax.spad
@@ -83,6 +83,9 @@ Syntax(): Public == Private where
buildSyntax: (%, List %) -> %
++ buildSyntax(op, [a1, ..., an]) builds a syntax object for op(a1,...,an).
+ nil?: % -> Boolean
+ ++ nil?(s) is true when `s' is a syntax for the constant nil.
+
getOperator: % -> Union(Integer, DoubleFloat, Symbol, String, %)
++ getOperator(x) returns the operator, or tag, of the syntax `x'.
++ The return value is itself a syntax if `x' really is an
@@ -147,6 +150,9 @@ Syntax(): Public == Private where
buildSyntax(op: %, l: List %): % ==
cons(op, l) pretend %
+ nil? x ==
+ null? rep x
+
getOperator x ==
atom? rep x => userError "atom as operand to getOperator"
s := car rep x