On Mon, 23 Oct 2006 08:27:32 +0900, David Vallner wrote:

> Robert Plantz wrote:
>> Can someone point me to documentation that describes the use of '#' 
>> other than as the comment character? Or perhaps tell me what I should 
>> have read before this tutorial?
>> 
> 
> This is a convention. GtkWindow#show means "instance method 'show' in
> the class GtkWindow". I've seen it used heavily in Smalltalk-related
> material, though the last time this topic came up (a year or so back?),
> someone came up with a more detailed "etymology". I'd tell you to check
> the mailing list archives, except I've no idea myself what I'd begin to
> search for...

Note that ri accepts this notation to refer to a class name when you're
asking for documentation (you may need to quote the whole thing in your
shell), but there is NO part of the Ruby language that accepts this
notation, nor do I really see much need.

To get an UnboundMethod object referring to the instance method 'show' in
the class 'GtkWindow', you use the code GtkWindow.instance_method(:show)
since the need for that in actual code pretty uncommon to begin with,
there's no reall need for more concise notation.

--Ken

-- 
Ken Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
I've added a signing subkey to my GPG key. Please update your keyring.