aboutsummaryrefslogtreecommitdiff
path: root/src
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
parent0d6564c18ff92a96f98c235b82a0da82556e5098 (diff)
downloadopen-axiom-59c74f79255a713a633fc6b7ca3e18ff89d018b7.tar.gz
* syntax.spad (nil?$Syntax): New predicate.
Diffstat (limited to 'src')
-rw-r--r--src/algebra/ChangeLog4
-rw-r--r--src/algebra/syntax.spad6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/algebra/ChangeLog b/src/algebra/ChangeLog
index 278e4ff3..3fd7f05d 100644
--- a/src/algebra/ChangeLog
+++ b/src/algebra/ChangeLog
@@ -1,3 +1,7 @@
+2007-12-11 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * syntax.spad (nil?$Syntax): New predicate.
+
2007-12-06 Gabriel Dos Reis <gdr@cs.tamu.edu>
* syntax.spad (Syntax): Add explicit conversion functions from
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