diff options
author | dos-reis <gdr@axiomatics.org> | 2008-01-14 12:17:21 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-01-14 12:17:21 +0000 |
commit | 4a4b92d282fbe89881b469ed0a8ac25bf33cad05 (patch) | |
tree | d730a25c62f6cddf337d4dedf55de6002ebb73da /src/algebra/syntax.spad | |
parent | ef3e16960ee4d9d1c02c1f63a7f8125a489d1373 (diff) | |
download | open-axiom-4a4b92d282fbe89881b469ed0a8ac25bf33cad05.tar.gz |
* interp/compiler.boot (compSymbol): Don't handle possible
case views here.
(hasUniqueCaseView): Rename from getUniqueCaseView. Take the
target mode as second argument.
(compForm2): Use calling convention vector to determine infer flag
parameter types.
(compCase1): Uniformly handle `case-expressions'. Call
genDeltaEntry for selected operator.
(coerceExtraHard): Handle coercions from UnionType domains.
(autoCoerceByModemap): Tidy.
* interp/g-opt.boot (optCall): Be more verbose in diagnostics.
* algebra/syntax.spad (Syntax): Rework.
* algebra/coerce.spad.pamphlet (UnionType): New.
* algebra/Makefile.pamphlet (axiom_algebra_layer_0):
Include UTYPE.o
* share/algebra: Update databases.
Diffstat (limited to 'src/algebra/syntax.spad')
-rw-r--r-- | src/algebra/syntax.spad | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/algebra/syntax.spad b/src/algebra/syntax.spad index 2dd65ccb..b6331f4f 100644 --- a/src/algebra/syntax.spad +++ b/src/algebra/syntax.spad @@ -43,7 +43,7 @@ ++ Fixme: Provide direct support for boolean values, arbritrary ++ precision float point values. Syntax(): Public == Private where - Public ==> CoercibleTo(OutputForm) with + Public ==> Join(UnionType, CoercibleTo(OutputForm)) with convert: % -> SExpression ++ convert(s) returns the s-expression representation of a syntax. @@ -55,26 +55,26 @@ Syntax(): Public == Private where coerce: Integer -> % ++ coerce(i) injects the integer value `i' into the Syntax domain - convert: % -> Integer + coerce: % -> Integer ++ coerce(i) extracts the integer value `i' from the Syntax domain coerce: DoubleFloat -> % ++ coerce(f) injects the float value `f' into the Syntax domain - convert: % -> DoubleFloat - ++ convert(f) extracts the float value `f' from the Syntax domain + coerce: % -> DoubleFloat + ++ coerce(f) extracts the float value `f' from the Syntax domain coerce: Symbol -> % ++ coerce(s) injects the symbol `s' into the Syntax domain. - convert: % -> Symbol - ++ convert(s) extracts the symbol `s' from the Syntax domain. + coerce: % -> Symbol + ++ coerce(s) extracts the symbol `s' from the Syntax domain. coerce: String -> % ++ coerce(s) injects the string value `s' into the syntax domain - convert: % -> String - ++ convert(s) extract the string value `s' from the syntax domain + coerce: % -> String + ++ coerce(s) extract the string value `s' from the syntax domain buildSyntax: (Symbol, List %) -> % ++ buildSyntax(op, [a1, ..., an]) builds a syntax object for op(a1,...,an). @@ -135,28 +135,28 @@ Syntax(): Public == Private where coerce(i: Integer): % == i pretend % - convert(i: %): Integer == + ccoerce(i: %): Integer == i case Integer => i userError "invalid conversion target type" coerce(f: DoubleFloat): % == f pretend % - convert(f: %): DoubleFloat == + coerce(f: %): DoubleFloat == f case DoubleFloat => f userError "invalid conversion target type" coerce(s: Symbol): % == s pretend % - convert(s: %): Symbol == + coerce(s: %): Symbol == s case Symbol => s userError "invalid conversion target type" coerce(s: String): % == s pretend % - convert(s: %): String == + coerce(s: %): String == s case String => s userError "invalid conversion target type" |