|
|
|
last edited 17 years ago by hemmecke |
| 1 2 | ||
|
Editor: hemmecke
Time: 2008/05/13 16:02:11 GMT-7 |
||
| Note: | ||
changed: -The following seems to be wrong since z should be implicitly local according to Section 6.16 of the 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 changed: -An output of 2 seems wrong again here. I would have expected 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.
(1) -> <spad>
)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>
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.
compiling local zzz : () -> Integer
Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** |Aaa| REDEFINED
;;; *** |Aaa| REDEFINED
Time: 0 SEC.
Cumulative Statistics for Constructor Aaa
Time: 0 seconds
finalizing NRLIB AAA
Processing Aaa for Browser database:
--->-->Aaa(constructor): Not documented!!!!
--->-->Aaa((foo ((Integer) (Integer)))): Not documented!!!!
--->-->Aaa(): Missing Description
; compiling file "/var/aw/var/LatexWiki/AAA.NRLIB/AAA.lsp" (written 15 MAR 2025 10:37:27 AM):
; wrote /var/aw/var/LatexWiki/AAA.NRLIB/AAA.fasl
; compilation finished in 0:00:00.004
------------------------------------------------------------------------
Aaa is now explicitly exposed in frame initial
Aaa will be automatically loaded when needed from
/var/aw/var/LatexWiki/AAA.NRLIB/AAAThe 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 .
foo(0)
| (1) |
)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
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:
7> fool(n: Integer): Integer ==
The current line is:
8> local z: Integer
The number of valid tokens is 1.
The prior token was #S(TOKEN
:SYMBOL SETTAB
:TYPE KEYWORD
:NONBLANK NIL
:LINE_NUM 8
:CHAR_NUM 8)
The current token is #S(TOKEN
:SYMBOL |local|
:TYPE KEYWORD
:NONBLANK NIL
:LINE_NUM 8
:CHAR_NUM 8)fool(0)
There are no library operations named fool Use HyperDoc Browse or issue )what op fool to learn if there is any operation containing " fool " in its name.
Cannot find a definition or applicable library operation named fool with argument type(s) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.
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.
)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
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:
7> foof(n: Integer): Integer ==
The current line is:
8> free z: Integer
The number of valid tokens is 1.
The prior token was #S(TOKEN
:SYMBOL SETTAB
:TYPE KEYWORD
:NONBLANK NIL
:LINE_NUM 8
:CHAR_NUM 8)
The current token is #S(TOKEN
:SYMBOL FREE
:TYPE KEYWORD
:NONBLANK NIL
:LINE_NUM 8
:CHAR_NUM 8)The following output of 2 should be fine.
foof(0)
There are no library operations named foof Use HyperDoc Browse or issue )what op foof to learn if there is any operation containing " foof " in its name.
Cannot find a definition or applicable library operation named foof with argument type(s) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type,or "$" to specify which version of the function you need.