Smalltalk: Assigning to a Variable Without Declaring a Variable in GNU Smalltalk

133 Views Asked by At

In Smalltalk, the GNU version 3.2.5, I do not get any errors when I do not declare a variable like so:

v := Array new: 10.

as opposed to:

| v |
v := 5.

But I was under the impression that there should be an error when I do this.

1

There are 1 best solutions below

1
On BEST ANSWER

That's a common thing in Workspaces (playground in Pharo). For code in the (class) browser the compiler is more strict (at least in Squeak/Pharo)