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

For example:

fricas
(1) -> n:TwoDimensionalArray Union ( Integer, Float):=new(2,2,0)

\label{eq1}\left[ 
\begin{array}{cc}
0 & 0 
\
0 & 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

fricas
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:

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

\label{eq3}\left[ 
\begin{array}{cc}
0 & 0 
\
0 & 0 
(3)
Type: TwoDimensionalArray?(Union(Integer,Float))
fricas
n::OUTFORM::SEX
Cannot convert the value from type OutputForm to SExpression .

Status: open => not reproducible




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