diff options
author | dos-reis <gdr@axiomatics.org> | 2011-02-08 19:44:03 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-02-08 19:44:03 +0000 |
commit | c3efb458ecde8f2b30f5b51ebeda24fbaf894ce9 (patch) | |
tree | 3121fd9043bf8eeb277305376461d6d1f595e354 /src/algebra | |
parent | 2a235748f5933b7514a01247afd5f73371a1e542 (diff) | |
download | open-axiom-c3efb458ecde8f2b30f5b51ebeda24fbaf894ce9.tar.gz |
* interp/lisp-backend.boot: Translate %ident? to IDENTP, not SYMBOLP.
* interp/compiler.boot (compMatch): test for identifier, not
atomic value.
* algebra/syntax.spad.pamphlet (Syntax): Tidy.
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/syntax.spad.pamphlet | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/algebra/syntax.spad.pamphlet b/src/algebra/syntax.spad.pamphlet index c62ff29a..4f399fff 100644 --- a/src/algebra/syntax.spad.pamphlet +++ b/src/algebra/syntax.spad.pamphlet @@ -119,7 +119,11 @@ Syntax(): Public == Private where import %integer?: % -> Boolean from Foreign Builtin import %float?: % -> Boolean from Foreign Builtin import %string?: % -> Boolean from Foreign Builtin + import %ident?: % -> Boolean from Foreign Builtin + import %pair?: % -> Boolean from Foreign Builtin import %equal: (%,%) -> Boolean from Foreign Builtin + import %head: % -> % from Foreign Builtin + import %tail: % -> List % from Foreign Builtin x = y == %equal(x,y) @@ -134,7 +138,7 @@ Syntax(): Public == Private where %string? s s case Identifier == - IDENTP(s)$Lisp + %ident? s coerce(x: %): OutputForm == -- For the moment, print syntax as s-expression. @@ -214,23 +218,23 @@ Syntax(): Public == Private where %peq(x,%nil) atom?(x: %): Boolean == - ATOM(x)$Lisp + not %pair? x getOperator x == atom? x => userError "atom as operand to getOperator" - op: % := %head(x)$Foreign(Builtin) - op case Identifier => op@Identifier - op case Integer => op@Integer - op case DoubleFloat => op@DoubleFloat - op case String => op@String - op + case (op := %head x) is + s@Identifier => s + i@Integer => i + d@DoubleFloat => d + s@String => s + otherwise => op compound? x == - CONSP(x)$Lisp + %pair? x getOperands x == atom? x => [] - %tail(x)$Foreign(Builtin) + %tail x coerce(x: %): InputForm == x : InputForm |