aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/syntax.spad
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-12-02 16:14:32 +0000
committerdos-reis <gdr@axiomatics.org>2007-12-02 16:14:32 +0000
commit0a95a6448e71e1d2dae08cafab5bf33426f17e61 (patch)
treefadfbdad7d147e0b2b4459e372b3252ccd7b0234 /src/algebra/syntax.spad
parent91e3f58e72d13cd2c3d0cf725dca5f5580ef8098 (diff)
downloadopen-axiom-0a95a6448e71e1d2dae08cafab5bf33426f17e61.tar.gz
* syntax.spad (buildSyntax): Overload on first argument type.
Diffstat (limited to 'src/algebra/syntax.spad')
-rw-r--r--src/algebra/syntax.spad8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/algebra/syntax.spad b/src/algebra/syntax.spad
index 383e1b59..0e12d19b 100644
--- a/src/algebra/syntax.spad
+++ b/src/algebra/syntax.spad
@@ -66,6 +66,9 @@ Syntax(): Public == Private where
buildSyntax: (Symbol, List %) -> %
++ buildSyntax(op, [a1, ..., an]) builds a syntax object for op(a1,...,an).
+ buildSyntax: (%, List %) -> %
+ ++ buildSyntax(op, [a1, ..., an]) builds a syntax object for op(a1,...,an).
+
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
@@ -104,9 +107,12 @@ Syntax(): Public == Private where
buildSyntax(s: Symbol, l: List %): % ==
-- ??? ideally we should have overloaded operator `per' that convert
-- from list of syntax to syntax. But the compiler is at the
- -- moment defective for non-exported operations.
+ -- moment defective for non-exported overloaded operations.
cons(convert(s)$%, l) pretend %
+ buildSyntax(op: %, l: List %): % ==
+ cons(op, l) pretend %
+
getOperator x ==
s := rep x
symbol? s => symbol s