Re: [Axiom-developer] Re: Assigning to Element of Array of Records Doesn't Seem to Work

Ralf Hemmecke <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user,gmane.comp.mathematics.axiom.devel
Message-ID <[email protected]>
Unfortunately, I don't know how to compile SPAD code inside MathAction.

The following program demonstrates that the issue
http://lists.nongnu.org/archive/html/axiom-mail/2007-08/msg00012.html
is an interpreter (not a SPAD compiler) problem.

Ralf

(1) -> )co bbb.spad
(1) -> zs := myfoo2()
    (1)  [[k= 0,rad= 0],[k= 10,rad= 0],[k= 0,rad= 0]]
    Type: OneDimensionalArray Record(k: Integer,rad: Integer)



---BEGIN bbb.spad
)abbrev package BBB MyPkg

INT==> Integer
R ==> Record(k: INT, rad: INT)

MyPkg(): with
   myfoo2: () -> OneDimensionalArray R
  == add
   initrec2(): R == [0,0]

   myfoo2(): OneDimensionalArray R ==
     xs: List R := [initrec2() for i in 1..3]
     ys: OneDimensionalArray R := oneDimensionalArray(xs)
     ys(2).k := 10
     ys
---END bbb.spad
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.