login  home  contents  what's new  discussion  bug reports help  links  subscribe  changes  refresh  edit

 Submitted by : (unknown) at: 2007-11-17T22:07:43-08:00 (11 years ago) Name : Axiom Version : default friCAS-20090114 Axiom-20050901 OpenAxiom-20091012 OpenAxiom-20110220 OpenAxiom-Release-141 Category : Axiom Aldor Interface Axiom Compiler Axiom Library Axiom Interpreter Axiom Documentation Axiom User Interface building Axiom from source lisp system MathAction Doyen CD Reduce Axiom on Windows Axiom on Linux Severity : critical serious normal minor wishlist Status : open closed rejected not reproducible fix proposed fixed somewhere duplicate need more info Optional subject :   Optional comment :

For example:

axiom
n:TwoDimensionalArray Union ( Integer, Float):=new(2,2,0)
 (1)
Type: TwoDimensionalArray?(Union(Integer,Float))

should display a rectangular array of numbers.

I debugged this a little but hit a wall. In ARR2CAT you find the appropriate conversion operation:
    if R has CoercibleTo(OutputForm) then

coerce(m:%) ==
l : List List OutputForm
l := [[qelt(m,i,j) :: OutputForm _
for j in minColIndex(m)..maxColIndex(m)] _
for i in minRowIndex(m)..maxRowIndex(m)]
matrix l


which really looks alright. Note also, that

axiom
Union(INT, FLOAT) has KOERCE OUTFORM
 (2)
Type: Boolean

and the operation is not overridden in ARRAY2 or IIARRAY2. But the miracle is, inserting a print("hi")$Lisp in the above operation shows that it actually doesn't get invoked. Somehow it seems to me that rather the following function from HOAGG gets invoked:  coerce(x:%):OutputForm == bracket commaSeparate [a::OutputForm for a in parts x]$List(OutputForm)


which can be seen by looking at:

axiom
n:TwoDimensionalArray Union(Integer, Float):=new(2,2,0)
 (3)
Type: TwoDimensionalArray?(Union(Integer,Float))
axiom
n::OUTFORM::SEX
 (4)
Type: SExpression?

Status: open => not reproducible

 Subject:   Be Bold !! ( 14 subscribers )