aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/syntax.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-06-01 00:22:44 +0000
committerdos-reis <gdr@axiomatics.org>2010-06-01 00:22:44 +0000
commit5b0462a5f0b499c2c3177e36e52b476875141969 (patch)
treea698fd6d161395245e4b1bdc349724f503ec8c44 /src/algebra/syntax.spad.pamphlet
parenta1eeda981dd4d753a805ff4a13a4ef26d167a7fb (diff)
downloadopen-axiom-5b0462a5f0b499c2c3177e36e52b476875141969.tar.gz
* interp/g-util.boot: Add more opcodes.
* algebra/syntax.spad.pamphlet: Clean up. * algebra/variable.spad.pamphlet: Likewise. * algebra/ystream.spad.pamphlet: Likewise.
Diffstat (limited to 'src/algebra/syntax.spad.pamphlet')
-rw-r--r--src/algebra/syntax.spad.pamphlet28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/algebra/syntax.spad.pamphlet b/src/algebra/syntax.spad.pamphlet
index ef4501ff..1579e187 100644
--- a/src/algebra/syntax.spad.pamphlet
+++ b/src/algebra/syntax.spad.pamphlet
@@ -114,17 +114,21 @@ Syntax(): Public == Private where
++ x case String is true if `x' really is a String
Private == add
+ import %integer?: % -> Boolean from Foreign Builtin
+ import %float?: % -> Boolean from Foreign Builtin
+ import %string?: % -> Boolean from Foreign Builtin
+
x = y ==
EQUAL(x,y)$Lisp
s case Integer ==
- INTEGERP(s)$Lisp
+ %integer? s
s case DoubleFloat ==
- FLOATP(s)$Lisp
+ %float? s
s case String ==
- STRINGP(s)$Lisp
+ %string? s
s case Identifier ==
IDENTP(s)$Lisp
@@ -198,10 +202,10 @@ Syntax(): Public == Private where
--% syntax construction
buildSyntax(s: Identifier, l: List %): % ==
- CONS(s,l)$Lisp
+ %makepair(s,l)$Foreign(Builtin)
buildSyntax(op: %, l: List %): % ==
- CONS(op,l)$Lisp
+ %makepair(op,l)$Foreign(Builtin)
nil? x ==
NULL(x)$Lisp
@@ -267,7 +271,9 @@ ElaboratedExpression(): Public == Private where
++ getOperands(e) returns the list of operands in `e', assuming it
++ is a call form.
- Private ==> add
+ Private == add
+ import %eq: (%,%) -> Boolean from Foreign Builtin
+ import %pair?: % -> Boolean from Foreign Builtin
isAtomic(x: %): Boolean ==
ATOM(x)$Lisp
@@ -275,7 +281,7 @@ ElaboratedExpression(): Public == Private where
getMode(x)$Lisp
callForm? x ==
- CONSP(x)$Lisp
+ %pair? x
getOperator x ==
op: SExpression := getUnnameIfCan(x)$Lisp
@@ -284,7 +290,7 @@ ElaboratedExpression(): Public == Private where
constant? x ==
isAtomic x and
- EQ(getUnnameIfCan(x)$Lisp, _$immediateDataSymbol$Lisp)$Lisp : Boolean
+ %eq(getUnnameIfCan(x)$Lisp, _$immediateDataSymbol$Lisp)
getConstant x ==
constant? x => getValue(x)$Lisp @ SExpression
@@ -580,8 +586,10 @@ Identifier(): Public == Private where
++ \spad{gensym()} returns a new identifier, different from
++ any other identifier in the running system
Private == add
- gensym() == GENSYM()$Foreign(Builtin)
- x = y == EQ(x,y)$Lisp
+ import %eq: (%,%) -> Boolean from Foreign Builtin
+ import %gensym: () -> % from Foreign Builtin
+ gensym() == %gensym()
+ x = y == %eq(x,y)
coerce(x: %): Symbol == x : Symbol
coerce(x: %): OutputForm == x : OutputForm