From: "David A. Black" Date: 2005-02-16T01:01:12+09:00 Subject: Re: Is this old style Ruby? Hi -- On Wed, 16 Feb 2005, Nikolai Weibull wrote: > * centrepins@gmail.com (Feb 15, 2005 16:16): >> So you would say use :: only for constant access, and use '.' for >> method access be it in a class or module? > > Well class-methods are constant as well in a sense, hence the use of > "::" in Why's book and it being the (at least old-school) idiom, I disagree; I don't think class methods are constant in any sense, any more than any other method definition. They're basically just per-object/singleton method definitions: class C def C.x end end like str = "abc" def str.x end etc. They have a semi-special status in the language (e.g., the existence of the #class_methods method), but when you call one, you're just sending a message to an object for method-call-based response. That's different from retrieving a constant, but it's not different from calling a method on any other object. David -- David A. Black dblack@wobblini.net