From: Przemek Wrzos Date: 2008-08-03T17:35:49+09:00 Subject: Re: Ruby 1.9 Binding#exec and introspection Hi nobu, Hmm, I see what you're saying about the binding being unknown at parse time. I think a Binding#exec method might still be possible but some extra work would be needed. Specifically the parser would have to generate a special dynamic type of binding object which would re-route the block's variables to the binding made available to it through #exec at runtime. This is starting to sound like a non-trivial problem though, I'm not sure it's actually worth the effort since you can get most of the benefits with some additional interface methods. Plus it would be tricky making this behaviour consistent with the rest of the language... I was thinking about what instance methods Binding might make available based on how Object treats instance variables. You'd probably need these: Binding#variable_defined? Binding#variable_get Binding#variable_set Binding#variables I'm not sure if what I proposed earlier would be possible because the parser might not make a specific distinction here, but the same sort of methods might also be helpful for #local_variables and #global_variables. On a side note. I would like to know how to take up this sort of discussion further with the developers of the language. Is there a formal proposal submission process that is still being used? Also, how would I go about maybe submitting a patch if I was interested in delving into the source code my self to implement something like this? Cheers -- Posted via http://www.ruby-forum.com/.