Re: A little print problem

Martin Rubey <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
"Alasdair McAndrew" <[email protected]> writes:

> Here it is:
> 
> F:=FFP(PF 2,x^3+x+1)
> x:=generator()$F

(24) -> for i in 0..7 repeat print([i, x^i]$List Union(INT, F))
   [0,1]
   [1,%A]
        2
   [2,%A ]
   [3,%A + 1]
        2
   [4,%A  + %A]
        2
   [5,%A  + %A + 1]
        2
   [6,%A  + 1]
   [7,1]
                                                                   Type: Void


The "problem" is not print, but rather that the simplest signature for the
constructor function in [i, x^i] the interpreter can find takes some F's and
returns a List F.  Above I explicitly told the interpreter to use the
constructor function that takes Union(INT, F)'s and returns a list of such
elements. Compare with

for i in 0..7 repeat print([i, x^i]::List Union(INT, F))

Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.