From: Kristof Bastiaensen Date: 2004-05-02T19:09:00+09:00 Subject: Re: def [](v) xx; return yy; end # returned value is ignored !? Hi, On Sun, 02 May 2004 03:08:36 +0900, Mark Hubbart wrote: > binding.local(:a) = 23 #=> 23 > a #=> 23 > binding.local(:a) += 19 #=> 42 > a #=> 42 > I wonder how you could make this work. binding.local(:a) would have to return something that could be used as a lvalue. I could be a reference, but the reason to have these methods would be to avoid them. Another way to do this: binding.local(:a).value = 23 binding.local(:a).value += 19 binding.local(sym) would then return something like a Variable class. It will still be possible to change the value of a variable, but not without participation of the calling scope. > also: > > binding.eval{ self } #=> main > Also here I would remove the eval. Maybe binding.get_self or binding.current_object? > .. 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. Yes, I agree. Maybe we could pack it up in a RCR? Kristof