aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/algebra/ChangeLog4
-rw-r--r--src/algebra/syntax.spad8
2 files changed, 11 insertions, 1 deletions
diff --git a/src/algebra/ChangeLog b/src/algebra/ChangeLog
index 57a741ad..d44a5731 100644
--- a/src/algebra/ChangeLog
+++ b/src/algebra/ChangeLog
@@ -1,3 +1,7 @@
+2007-12-02 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * syntax.spad (buildSyntax): Overload on first argument type.
+
2007-11-15 Gabriel Dos Reis <gdr@cs.tamu.edu>
* Makefile.pamphlet (axiom_algebra_layer_19): Include SPADPRSR.o
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