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 (10 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

For example:

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

\label{eq1}\left[ 0, \: 0, \: 0, \: 0 \right](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

\label{eq2} \mbox{\rm true} (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)

\label{eq3}\left[ 0, \: 0, \: 0, \: 0 \right](3)
Type: TwoDimensionalArray?(Union(Integer,Float))
axiom
n::OUTFORM::SEX

\label{eq4}\left(\hbox{\axiomType{BRACKET}\ } \ {\left(\hbox{\axiomType{AGGLST}\ } \  0 \  0 \  0 \  0 \right)}\right)(4)
Type: SExpression?

Status: open => not reproducible




  Subject:   Be Bold !!
  ( 13 subscribers )  
Please rate this page: