[Aldor-l] Re: [Axiom-math] Dynamically constructed return types / Aldor
Martin Rubey
martin.rubey at univie.ac.at
Mon Jan 10 05:48:14 EST 2005
Dear Tim, *
root writes:
> I'm sorry but your note suffers from "context depravation", that is,
> a fancy way of say "what?".
Sorry, I was a bit short. The "proof of concept" I delivered shows that
contrary to the axiom-spad compiler, aldor allows dependent types in function
signatures. I.e., you can define a package or domain FOO that exports a
function whose return type depends on the *function* parameter! In axiom, it
may only depend on domain or package parameters. For example:
FOO: with {f:(n:Integer)->IntegerMod(n) } ==
add {f(n:Integer):IntegerMod(n) == coerce(10)$IntegerMod(n) }
Marcus Better ran into a situation where this is needed. In the axiom algebra,
the file expr2ups.spad makes heavy use of the Any domain, which could be
avoided if we could use the Aldor compiler.
> re: Aldor. It should work with Axiom. Aldor has options which allow it to
> generate Axiom domains which can be loaded.
No, it does not work anymore. More precisely: You *can* compile a *function*
with the Aldor compiler and use it in Axiom, as shown in
http://lists.nongnu.org/archive/html/axiom-mail/2004-09/msg00035.html
But the examples in
http://www.csd.uwo.ca/~watt/aldor/UserGuide/chap18.html#1
do not work. They should, but they don't. I would be *VERY* grateful, if you
could give me pointers.
Martin
More information about the Aldor-l
mailing list