From ruby-talk Tue Feb 15 21:13:28 2005 From: "Jason Voegele" Date: Tue, 15 Feb 2005 21:13:28 +0000 To: ruby-talk Subject: Re: Is this old style Ruby? Message-Id: <10391.192.223.163.5.1108501991.squirrel () 192 ! 223 ! 163 ! 5> X-MARC-Message: https://marc.info/?l=ruby-talk&m=110850202520214 Florian Gross said: > And you can not use :: for accessing methods that start with an > uppercase letter: That's not exactly true: irb(main):001:0> Integer("42") => 42 irb(main):002:0> Kernel.Integer("42") => 42 irb(main):003:0> Kernel::Integer("42") => 42 If you supply a parameter list (or even empty parentheses), ruby will use :: for accessing methods with an uppercase letter, otherwise it will assume you are trying to access a constant. > irb(main):001:0> def Xing(); end; self::Xing > TypeError: main is not a class/module irb(main):013:0> self::Xing() => nil -- Jason Voegele "There is an essential core at the center of each man and woman that remains unaltered no matter how life's externals may be transformed or recombined. But it's smaller than we think." -- Gene Wolfe, The Book of the Long Sun