It only works because the compiler adds 'aClass' to the method's list of temps when it discovers it in the block, and then doesn't rescind its scope correctly and the doens't take notice of it later. I did some hacking to make block temps work a while ago that 'fixed' this, I'll try to remember to extract the relevant bits tomorrow.
What should be written there is .......setClass:[:aClass| theClass := aClass]. and 'the Class' would need be a proper method temp.
tim
Tim--
Thanks for clearing this up. My understanding of scoping is no longer swinging in the breeze. I guess this is part of the whole closures inconsistency.
--Maurice
--------------------------------------------------------------------------- Maurice Rabb 773.281.6003 Stono Technologies, LLC Chicago, USA
The whole things is probably an archeological artefact from the Smalltalk-76 days when the prehistorical grand-parents of today's common blocks lived. Maybe Dan can explain better how blocks came into being and what their semantics were back then.
Hans-Martin
squeak-dev@lists.squeakfoundation.org