a newbie question (disregard earlier message)
Hari Balaraman
hbalaram2 at yahoo.fr
Wed Jan 9 22:47:46 UTC 2002
Hi all,
I'm attempting to learn Smalltalk and would like to post a small
question. I apologise in advance if this is is not the appropriate forum
for basic questions. Is so please point me in the direction of the
relevant forum. Any assistance will be greatly appreciated.
Thanks much,
Hari
what follows is the method I wrote for the following problem: write an
array in which each element is the square of the corresponding element
in the receiver array. I cannot find out what I am doing wrong:
arraySquared
|squarearray |
squarearray := Array new: (self size).
1 to self size
do: [:index | squarearray at: index put:((self at:
index)*(self at: index))].
^ squarearray
More information about the Squeak-dev
mailing list
|