From 59c74f79255a713a633fc6b7ca3e18ff89d018b7 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Wed, 12 Dec 2007 05:18:09 +0000 Subject: * syntax.spad (nil?$Syntax): New predicate. --- src/algebra/syntax.spad | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/algebra/syntax.spad') 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 -- cgit v1.2.3