Hello Jeff,

Wednesday, October 30, 2002, 8:43:10 PM, you wrote:

GJ> Is there a way, through native Ruby code or through C extensions, to access
GJ> (presumably through a String) the original source of a block object?  The
GJ> context for this idea is an interactive modeling application, where a user
GJ> writes a base model in Ruby, using blocks to encode the behavior of certain
GJ> objects in the system, then uses a GUI that allows interactive editing of
GJ> these blocks during a run of the model so that behavior can be changed on
GJ> the fly.  I'd prefer to have the base source be "live" Ruby code and not
GJ> strings that are eval'ed.

i think you need method to COMPILE string into block, like:

block = compile("{|x| x*2}")
p block.call(2)    #=>4


-- 
Best regards,
 Bulat                            mailto:bulatz / integ.ru