j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
The "block := ..." statement is the code... I just sent the #value: message at the end for an example. You could have returned the block instead of evaluating it. For example, Integer>>foo | test | test := 5. ^Compiler new evaluate: '[:a | a + test + self]' in: thisContext to: self notifying: nil ifFail: [nil] will return a block content that you can then send #value: to (4 foo value: 10 ==> 19)...
ah, yes. i was throw off by "evaluate".
If you don't want access to variables declared outside the block, you can simply use: Compiler evaluate: '[ :foo | foo bar]'
actually, that is precisely what i wanted! thanks!!
dave
-- j. david farber oo architect+mentor numenor labs incorporated in sunny boulder colorado dfarber@numenor.com www.numenor.com
squeak-dev@lists.squeakfoundation.org