[Newbies] how can I compile a String to BlockContext?

Albert Lee hanzhupeng at gmail.com
Fri Feb 27 07:12:53 UTC 2009


aka  eval, in python:

>>> eval('3 + 5')
8


I guess there is some method can do this in smalltalk.
like this:

| s b|
s := '[:x | x + 5]'
b := SOME_WAY s
" b is a block now"
b value: 3


More information about the Beginners mailing list