aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-06-14 12:26:50 +0000
committerdos-reis <gdr@axiomatics.org>2009-06-14 12:26:50 +0000
commit12b1b74f1e952694c8f182eb2b4ab369f6005ddf (patch)
tree70446f3ea05944feb6beb68dd35f27573d9ee6f6 /src/algebra
parent700e13eca3eaac940000e3529d761dc7b4b15e5e (diff)
downloadopen-axiom-12b1b74f1e952694c8f182eb2b4ab369f6005ddf.tar.gz
Add support for existential type recovery.
* interp/compiler.boot (compRecoverDomain): New. Split from compRecoverGuard. (compRecoverGuard): Split. Handle existential type recovery. (compScheme): New. Register as compiler. * interp/g-opt.boot (optLET*): New. Turn into LET-form if appropriate. Register as backend transformer. * interp/fnewmeta.lisp (|PARSE-Scheme|): New. (|PARSE-Quantifier|): Likewise. (|PARSE-QuantifiedVariableList|): Likewise. (|PARSE-QuantifiedVariable|): Likewise. * interp/metalex.lisp (KEYWORDS): Add 'forall' and 'exist' as new keywords. * interp/newaux.lisp: Register parser for expression schemes. * algebra/any.spad.pamphlet (=$Any): If the underlying domain has BasicType, use that equality operator. (coerce$Any): If the underlying domain has CoercibleTo OutputForm then use it.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/any.spad.pamphlet11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/algebra/any.spad.pamphlet b/src/algebra/any.spad.pamphlet
index e7818eb2..b15f486f 100644
--- a/src/algebra/any.spad.pamphlet
+++ b/src/algebra/any.spad.pamphlet
@@ -143,6 +143,7 @@ import None
)abbrev domain ANY Any
++ Author: Robert S. Sutor
++ Date Created:
+++ Date Last Updated: June 14, 2009.
++ Change History:
++ Basic Functions: any, domainOf, objectOf, dom, obj, showTypeInOutput
++ Related Constructors: AnyFunctions1
@@ -191,7 +192,10 @@ Any(): SetCategory with
obj x == x.ob
dom x == x.dm
domainOf x == x.dm pretend OutputForm
- x = y == (x.dm = y.dm) and EQ(x.ob, y.ob)$Lisp
+ x = y ==
+ case (x,y) is
+ (x': exist(S: BasicType) . S, y': S) => x' = y'
+ otherwise => EQ(x,y)$Foreign(Builtin)
objectOf(x : %) : OutputForm ==
spad2BootCoerce(x.ob, x.dm,
@@ -203,7 +207,10 @@ Any(): SetCategory with
"Type of object will not be displayed in output of a member of Any"
coerce(x):OutputForm ==
- obj1 : OutputForm := objectOf x
+ obj1 : OutputForm :=
+ case x is
+ x': exist(S: CoercibleTo OutputForm) . S => x'::OutputForm
+ otherwise => (x.ob pretend SExpression)::OutputForm
not deref printTypeInOutputP => obj1
dom1 :=
p:Symbol := prefix2String(devaluate(x.dm)$Lisp)$Lisp