From: Mark Hubbart Date: 2004-05-02T03:08:36+09:00 Subject: Re: def [](v) xx; return yy; end # returned value is ignored !? On May 1, 2004, at 3:59 AM, Kristof Bastiaensen wrote: > It may be interesting to be able to access variables indirectly > using binding() (outside eval). > for example: > > a = 2 > binding().local_get(:a) > => a == 2 > > binding().local_set!(:a, 5) > => a == 5 > > And also Binding::ivar_set!, Binding::ivar_get and > Binding::get_self or: binding.local(:a) = 23 #=> 23 a #=> 23 binding.local(:a) += 19 #=> 42 a #=> 42 also: binding.eval{ self } #=> main ... would be nice. I dislike having to eval strings when I need to do some work within a certain binding; and I suppose that code blocks will compile nicer, especially when we get a VM.