temporary block variables
Craig.Latta at NetJam.ORG
Tue Sep 21 02:54:00 UTC 1999
('Sorry for the delay... I've just caught up on my mail after various summer diversions.)
> > [http://netjam.org/self/projects/smalltalk/sources/blockTemps1f.zip] is
> > useful as long as you don't need to declare a temporary block variable with
> > the same name as another temporary block or method variable in the same
> > method.
> Unfortunately, I do it all over the place, as in,
> answers1 := eventList collect: [ :assoc | | event | ...].
> answers2 := eventList collect: [ :assoc | | event | ...]
Oops; I was a bit overly conservative there. The above code would be fine, since the scopes in which you want to use 'assoc' are separate. Nesting them would be the problem.
composer and computer scientist
craig.latta at netjam.org
latta at interval.com
Smalltalkers do: [:it | All with: Class, (And love: it)]
More information about the Squeak-dev