[Q] Any reason why there is no "BlockContext >> storeOn:" ?

Lex Spoon lex at cc.gatech.edu
Thu Oct 30 21:57:11 UTC 2003


Julian Fitzell <julian at beta4.com> wrote:
> BlockContexts are very dependant on the context in which they were 
> created.  We can refer to variables in that scope.  While you might be 
> able to write out [1 + 1], how do you write out [foo + 1] ?  I have no 
> idea what/if any the solutions for this are, but I'm pretty sure that's 
> the reason it isn't done at the moment.  It's just not as simple as 
> writing out the source code that was used when creating the block; the 
> entire cont



If someone wants to support things like  [1 + 1] and [ :x | x + 1], then
you could use the decompiler and check the results for any free
variables.  If there are no free variables, then you should be able to
safely save the block as a string.

Along similar lines, it would be nice to have a better printString for
blocks, too.  :)

-Lex



More information about the Squeak-dev mailing list