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

Edit detail for SandBoxLexicalScope revision 1 of 12

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

changed:
-
j is referenced out of scope
\begin{axiom}
for i in 1..5 repeat
        j:Integer := i^2
        output(i::OutputForm)$OutputPackage
output(j::OutputForm)$OutputPackage
\end{axiom}
The above code snippet returns an error in OpenAxiom 1.2.0 (Revision >= 563).

It sould be written like this:
\begin{axiom}
j: Integer
for i in 1..5 repeat
        j := i^2
        output(i::OutputForm)$OutputPackage
output(j::OutputForm)$OutputPackage
\end{axiom}

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 above code snippet 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