From: "ara.t.howard" Date: 2008-04-05T00:38:03+09:00 Subject: Re: Lookup of Capitalized Methods On Apr 4, 2008, at 9:27 AM, Trans wrote: > Right it does. But it's not a "pollution" we are unaccustomed to --it > is merely constant lookup. So we can conceive of these as Constant > Methods. > > However, you make a point. In having these it would probably require > we enforce that normal methods can not be capitalized. But, as Robert > says, they are rarely used. In fact, I would argue that when they are > used it is probably alwasy to achieve exactly the kind of > functionality this change would support. it's more complicated than that: module M def Clobber end Const = 42 def self.included other :nothing end end class C include M end if you want method lookup to behave like constant lookup this would *have* to inject the Clobber method into C. this is not widely appreciated, but ruby injects the constants from a module into a class on inclusion *regardless* of any 'self.included' hook defined. so to maintain consistency between methods and constants we'd have to either A) have the above code cherry-pick caps methods and include them silently behind our backs B) Not have constants injected during module inclusion feels a bit like standing on an icy roof to me... a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama