diff options
author | dos-reis <gdr@axiomatics.org> | 2007-12-02 16:14:32 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2007-12-02 16:14:32 +0000 |
commit | 0a95a6448e71e1d2dae08cafab5bf33426f17e61 (patch) | |
tree | fadfbdad7d147e0b2b4459e372b3252ccd7b0234 /src/algebra | |
parent | 91e3f58e72d13cd2c3d0cf725dca5f5580ef8098 (diff) | |
download | open-axiom-0a95a6448e71e1d2dae08cafab5bf33426f17e61.tar.gz |
* syntax.spad (buildSyntax): Overload on first argument type.
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/ChangeLog | 4 | ||||
-rw-r--r-- | src/algebra/syntax.spad | 8 |
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 |