From: dblack@... Date: 2007-08-04T06:57:23+09:00 Subject: Re: binding - how to explain it? Hi -- On Sat, 4 Aug 2007, Giles Bowkett wrote: > Hi Morton - actually, that is entirely relevant. I think it indicates > that you get the binding from the calling context, rather than the > defining context. But it seems to contradict what David Black posted > earlier, and I saw the same thing in my own irb. I don't think it contradicts my example; I'm evaluating "puts a" inside a method where a has not been defined. Morton's examples either use the top-level binding explicitly, or set an a variable in the method. My example doesn't do either, so the top-level assignment to a is essentially playing no role. David -- * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com)