From: GOTO Kentaro Date: 2001-11-13T02:20:30+09:00 Subject: [ruby-talk:24944] Re: Naming conventions In message "[ruby-talk:24940] Re: Naming conventions" Paul Brannan writes: > As far as whether it is a good idea to have a method and a constant with > the same name, imo this probably isn't a good idea. However, naming a > method with a capital letter is commonly used to indicate that the method > is a factory for some particular type (DelegateClass() is a factory for > delegate classes, for example). On the other hand, Ruby also has Array(), Float(), Integer(), and String(). def (a=0.1).to_s() nil end; p String(a) #=> (TypeError) p String(0.1) #=> "0.1" def (b=0.1).to_str() to_s end; p String.new(b) #=> "0.1" p String.new(0.1) #=> (TypeError) Maybe these show an implicit convention on converter method. -- Gotoken