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

Submitted by : (unknown) at: 2007-11-17T22:34:27-08:00 (17 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

This page demonstrages a bug with setelt.

From the first report by Bill Wood:

http://lists.nongnu.org/archive/html/axiom-mail/2007-08/msg00012.html

fricas
(1) -> init_rec() == (r : Record(k: INT, rad: INT) := [0,0]; r)
Type: Void
fricas
xs := [init_rec() for i in 1..3];
fricas
Compiling function init_rec with type () -> Record(k: Integer,rad: 
      Integer)
Type: List(Record(k: Integer,rad: Integer))
fricas
ys := oneDimensionalArray(xs);
Type: OneDimensionalArray?(Record(k: Integer,rad: Integer))
fricas
xs(2).k := 5

\label{eq1}5(1)
Type: PositiveInteger?
fricas
xs.2.k := 5

\label{eq2}5(2)
Type: PositiveInteger?
fricas
ys(2).k := 10

\label{eq3}10(3)
Type: PositiveInteger?
fricas
ys.2.k := 5

\label{eq4}5(4)
Type: PositiveInteger?

Here is a demonstration that shows that the Aldor compiler has no problem with that construction.

aldor
#include "axiom"
INT ==> Integer;
R ==> Record(k: INT, rad: INT);
initrec(): R == [0,0];
myfoo(): OneDimensionalArray R == {
  xs: List R := [initrec() for i in 1..3];
  ys: OneDimensionalArray R := oneDimensionalArray(xs);
  ys(2).k := 10;
  ys
}
aldor
   Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/3344069441329748634-25px002.as
      using Aldor compiler and options 
-O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra
      Use the system command )set compiler args to change these 
      options.
"/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/3344069441329748634-25px002.as", line 1: 
#include "axiom"
^
[L1 C1] #1 (Error) Could not open file `axiom'.
The )library system command was not called after compilation.

fricas
zs:=myfoo()
There are no library operations named myfoo Use HyperDoc Browse or issue )what op myfoo to learn if there is any operation containing " myfoo " in its name.
Cannot find a no-argument definition or library operation named myfoo .

And the following code demonstrates that the problem lies in the interpreter and not in the SPAD compiler.

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
spad
   Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/8672852723378779648-25px004.spad
      using old system compiler.
   BBB abbreviates package MyPkg 
------------------------------------------------------------------------
   initializing NRLIB BBB for MyPkg 
   compiling into NRLIB BBB 
   compiling local initrec2 : () -> Record(k: Integer,rad: Integer)
      BBB;initrec2 is replaced by CONS00 
Time: 0 SEC.
compiling exported myfoo2 : () -> OneDimensionalArray Record(k: Integer,rad: Integer) Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** |MyPkg| REDEFINED
;;; *** |MyPkg| REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor MyPkg Time: 0 seconds
finalizing NRLIB BBB Processing MyPkg for Browser database: --->-->MyPkg(constructor): Not documented!!!! --->-->MyPkg((myfoo2 ((OneDimensionalArray (Record (: k (Integer)) (: rad (Integer))))))): Not documented!!!! --->-->MyPkg(): Missing Description ; compiling file "/var/aw/var/LatexWiki/BBB.NRLIB/BBB.lsp" (written 26 JAN 2025 02:06:27 AM):
; wrote /var/aw/var/LatexWiki/BBB.NRLIB/BBB.fasl ; compilation finished in 0:00:00.004 ------------------------------------------------------------------------ MyPkg is now explicitly exposed in frame initial MyPkg will be automatically loaded when needed from /var/aw/var/LatexWiki/BBB.NRLIB/BBB

fricas
zs:=myfoo2()

\label{eq5}\left[{\left[{k = 0}, \:{rad = 0}\right]}, \:{\left[{k ={10}}, \:{rad = 0}\right]}, \:{\left[{k = 0}, \:{rad = 0}\right]}\right](5)
Type: OneDimensionalArray?(Record(k: Integer,rad: Integer))

Status: open => closed




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