From: Hal Fulton Date: 2005-02-16T08:47:07+09:00 Subject: Re: Is this old style Ruby? David A. Black wrote: > Hi -- > > On Tue, 15 Feb 2005 centrepins@gmail.com wrote: > >> Page 349 of the (printed) pickaxe2 mentions '::' and '.', but doesn't >> really suggest which one is best to use. So I guess it's possibly one >> of those "preffered-style" things? > > > I've never seen :: used where the receiver was anything but a Class or > Module, and usually for constant access rather than method access. > *Please* let's not start seeing it in the general case.... Some people do it -- I've seen it before, but I don't advocate it. It smells like C++ to me. >> It seems a little bit odd to me to have two ways of doing the same >> thing. Seems best (as was mentioned above) to stick to :: for module >> access and . for everything else. ?? > > I would advocate :: for constant access, and . for method access. I also advocate . for methods. :: is necessary for constants. (I once started a thread where I wondered why we couldn't use dot for constants -- but eventually I painted myself into a corner and realized "it's already done the right way.") Hal