From: Martin DeMello Date: 2005-12-16T08:07:39+09:00 Subject: Re: Assigning a block to a variable in Ruby Mark J. Reed wrote: > Martin DeMello writes: > >ajmayo@my-deja.com wrote: > >> evaluate the function with parameter 1, then attempt to print the > >> function itself (which Javascript will do, printing the text of the > >> block) > > >Ruby does not do this. > > More specifically: in Ruby, unlike Python and JavaScript, methods are > *not* variables with closure values. You can persuade Ruby to turn a > method into a closure value, but that's not how they live, and methods > do not occupy variable namespace. So defining a method 'foo' does not > have any affect on the variable > 'foo', or vice versa: Actually, what I meant was that ruby does not store the source code of the method anywhere, so it cannot be introspected. martin