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

Edit detail for SandBoxLexicalScope revision 2 of 12

1 2 3 4 5 6 7 8 9 10 11 12
Editor: Bill Page
Time: 2008/05/11 06:47:48 GMT-7
Note: new

changed:
-The above code snippet returns an error in OpenAxiom 1.2.0 (Revision >= 563).
The code above returns an error in OpenAxiom 1.2.0 (Revision >= 563).

j is referenced out of scope

axiom
for i in 1..5 repeat j:Integer := i^2 output(i::OutputForm)$OutputPackage 1 2 3 4 5
Type: Void
axiom
output(j::OutputForm)$OutputPackage 25
Type: Void

The code above returns an error in OpenAxiom? 1.2.0 (Revision >= 563).

It sould be written like this:

axiom
j: Integer
Type: Void
axiom
for i in 1..5 repeat j := i^2 output(i::OutputForm)$OutputPackage 1 2 3 4 5
Type: Void
axiom
output(j::OutputForm)$OutputPackage 25
Type: Void