Helpful Information
 
 
Category: Other Programming Languages
Smalltalk - assigning values to a Set using a loop

Hi all.

I am trying to assign the numbers 1 through to 20 to a Set, this is the code so far


|aSet i|


aSet := Set new.
i := 1.
[ i = aUpperBound] whileFalse: [i := i+1. aSet add:i].

But it says that it cannot find the Set (aSet), what am I doing wrong?

Jake










privacy (GDPR)