axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Re: [Axiom-math] Dynamically constructed return types


From: Martin Rubey
Subject: [Axiom-developer] Re: [Axiom-math] Dynamically constructed return types / Aldor
Date: Mon, 10 Jan 2005 11:48:14 +0100

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]