From 0a95a6448e71e1d2dae08cafab5bf33426f17e61 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 2 Dec 2007 16:14:32 +0000 Subject: * syntax.spad (buildSyntax): Overload on first argument type. --- src/algebra/syntax.spad | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/algebra/syntax.spad') 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 -- cgit v1.2.3