[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## [Axiom-developer] Re: [Axiom-math] (no subject)

**From**: |
Martin Rubey |

**Subject**: |
[Axiom-developer] Re: [Axiom-math] (no subject) |

**Date**: |
Mon, 20 Jun 2005 16:25:26 +0200 |

Ralf Hemmecke writes:
>* > > (7) I tried using a list to return multiple variables from a*
>* > > function. However, this turns out to be of type any. These variables*
>* > > can be displayed but not used in operations any further. This means*
>* > > that you have to remember the types of each variable in the list.*
>* > > Then, manually in the calling function extract and explicitly typecast*
>* > > each variable in the returned list. Is there an easier way of doing*
>* > > this ??*
>* *
>* I am somehow surprised that Axiom cannot work with multivalues.*
>* *
>* (1) -> foo(a: Integer, b: Integer): (String, Integer) == ("sum", a+b);*
>* *
>* The constructor Tuple takes 1 argument and you have given 2 .*
>* (1) -> foo: (Integer, Integer) -> (String, Integer)*
>* *
>* The constructor Tuple takes 1 argument and you have given 2 .*
>* *
In axiom you need to use records:
foo(a: Integer, b: Integer): Record(s: String, r:Integer) == ("sum", a+b);
Martin
(Although I'm completely convinced that Aldor is superiour)