Hi Ralf, Martin, Gaby and all,
I agree with all the Ralf mail, but I pain to explain that I don't see
how to use easily pairs/tuples in axiom when the coordonates aren't
of the same type (so I don't speak about Complex which can be a Vector)
By example (Integer, Float).
Of corse I may use List Any,
but I don't think it's the better description of a pair/couple.
There is no one type control.
There are
1/ List for sequences of the same type L := [11,22,33]
2/ Vector for linear algebra V := vector [a,a+1,a+2]
3/ Set if we don't look at the order S := {4,5,6} or set [4,5,6]
4/ Cross / Record / DirectProduct for product
but there is no natural/mathematical syntax.
A mathematical consistent syntax might be
RR := [| 12, 5.0e-7 |] ; RR.1 ; RR.2
The actual Axiom forces to declare the record and choose the field name :
RR : Record (a:Integer, b:Float) := [12, 5.0e-6]
This semantic is far from the other data structures.
I expect to have a syntax as near as possible as other data structures.
So don't have to declare the record and don't choose the field name.
Martin proposes to hide Any.
I agree that it might create other usability problems.
an other operator as [|...|] reduces this conflict.
[Martin]> However, turning to Axiom again, as soon as we have a type Any in
> scope, the interpreter has no way to know whether we mean List Any
> or Record(String, INT) with ["a", 1].
> We could, of course, unexpose Any, and introduce unnamed Records, a
> function explode and multiple values. I'm not sure whether this
> wouldn't create other usability problems.
For Ralf :
----------
> if you work in the interpreter, it is probably reasonable to use some
> Record construction. However, if you do serious programming [...]
I approve axiom promotes
> [...] a "mathematical" domain instead of just such a thumb (record)
> data structure.
For an educational purpose we often must code one or two loops or
tests. And I can only use interpreter with students. My purpose is
about this << concrete >> mathematics, not teach a new language
and the domains.
A common example
----------------
But imagine I study a sequence u(n) of rational number
where u(0) is an integer a.
I want to see when u(n) is near of the real limit l.
So I buld a list of interessing data (for a next plot).
Record (index : NNI = n, initial : INT= a, val : RationalNumber = u(n),
error : Float = u(n) - l)
Sometime ago Alasdair looks for a pretty
> >> for n in 10..30 repeat output [n, factor(2^n-1)]
Francois
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
open-axiom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel