fricas (1) -> <spad> fricas )abbrev domain AAA Aaa
Aaa: with
foo: Integer -> Integer
== add
z: Integer := 0
zzz: () -> Integer
foo(n: Integer): Integer ==
z := 1
n + 2*zzz()
zzz(): Integer == z</spad>
fricas Compiling FriCAS source code from file
/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/8846046079375810821-25px001.spad
using old system compiler.
AAA abbreviates domain Aaa
------------------------------------------------------------------------
initializing NRLIB AAA for Aaa
compiling into NRLIB AAA
compiling exported foo : Integer -> Integer
Time: 0 SEC.The following seems to be wrong. The variable z in the body of foo is "assigned a value before it is referenced, so it is a local variable", according to Section 6.16 of the Axiom Book . fricas foo(0)
Type: PositiveInteger?
spad )abbrev domain AAAL AaaLocal
AaaLocal: with
fool: Integer -> Integer
== add
z: Integer := 0
zzzl: () -> Integer
fool(n: Integer): Integer ==
local z: Integer
z := 1
n + 2*zzzl()
zzzl(): Integer == z
spad Compiling FriCAS source code from file
/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/7742866875728626797-25px003.spad
using old system compiler.
AAAL abbreviates domain AaaLocal
******** Spad syntax error detected ********
Expected: BACKTAB
The prior line was:fricas fool(0) An output of 2 seems wrong again here. I even have explicitly declared z to be local. I would have expected 0. But somehow the assignment escapes into zzzl. spad )abbrev domain AAAF AaaFree
AaaFree: with
foof: Integer -> Integer
== add
z: Integer := 0
zzzf: () -> Integer
foof(n: Integer): Integer ==
free z: Integer
z := 1
n + 2*zzzf()
zzzf(): Integer == z
spad Compiling FriCAS source code from file
/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/2076018909214082053-25px005.spad
using old system compiler.
AAAF abbreviates domain AaaFree
******** Spad syntax error detected ********
Expected: BACKTAB
The prior line was:The following output of 2 should be fine. fricas foof(0) |