On Mon, Nov 13, 2006 at 12:22:26AM +0900, Robert Dober wrote:
> On 11/12/06, Mauricio Fernandez <mfp / acm.org> wrote:
> >On Sun, Nov 12, 2006 at 11:06:44PM +0900, Christian Surlykke wrote:
> >> Specifically, what I'd like to do:
> >>   l = lambda { puts a }  # 'a' not defined at this point.
> >>   eval('a = 7', l.binding)  # Hope to create a in l's binding
> >>   l.call                             # Hope to get '7'
> >l = lambda{ eval 'a' }
> >eval('a = 7', l.binding)
> >l.call                                             # => 7
> >eval('a')                                          # => 7
> >
> >If you try to use 'a' before the parser sees 'a = ...', it will be
> >considered a method call, and you'll get a NameError even if you give it a
> >value afterwards/in eval.
> >
> >BTW. this is changing in 1.9.

(Just to be clear, "this" == semantics of  eval("local_var")).

> And yes Mauricio can you give a pointer to the new behavior please, thx.

[ruby-core:09388]

I'll be glad to see that happen; it's something I've been wanting for some
time. I became concerned about closures being "too wide" by the end of
2003/early 2004 and was close to writing a RCR.
(http://thekode.net/misc/survey.txt --- note: I'm not collecting responses
anymore :)
[ruby-core:09388] can be interpreted as a step in that direction.


PS: your email made me think of the zero derivation of eigenclass and
"verbing" it in sentences like
  "I want to eigenclass myself" or
  "eigenclassing oneself demands constant effort"
which could be the first use ever with the obvious newly-coined? acception :)
-- 
Mauricio Fernandez  -   http://eigenclass.org   -  singular Ruby