From: YANAGAWA Kazuhisa Date: 2006-04-28T12:02:48+09:00 Subject: Re: difference between :: and . in calling methods In Message-Id: dblack@wobblini.net writes: > Let me clarify that: > > :: as a method-call operator is never used, except with class/module > receivers. > > :: is also the (one and only) constant path separator. That's why > Numeric doesn't work; Numeric isn't a method. > > The dual role of :: is what led to your confusion in that example, as > it has for many people. Note: "::" notation for a method invocation was introduced since someone wanted to call a "class method" in that fashion like as in C++ or Java, and Matz agreed --- or at least didn't rejected. On the other hand "." notation is core syntax for a method invocation before that. # "::" for a constant path separator was older than "::" for methods # too. I personally prefer "." for all method invocations because I'm too lazy to remember which method should be called which, and feel using "." is reflecting the model that some class is an instance of class Class. -- kjana@dm4lab.to April 28, 2006 What can't be cured must be endured.