From: Phil Tomson Date: 2006-06-15T01:07:34+09:00 Subject: Re: Why the lack of mixing-in support for Class methods? On 6/13/06, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Why the lack of mixing-in support for Class methods?" > on Wed, 14 Jun 2006 15:34:43 +0900, "Phil Tomson" writes: > > |> class_extension do > | > |Maybe it could be called class_methods ? > > I thought of the name first, but I changed my mind because it is too > similar to methods with different behavior e.g. private_methods. > Besides that class_extension can be used for something other than > methods, for example, constant definition. > > |> Foo.im > | > |Do you mean Foo.cm ? > > Yes. What a shame. > > |Is this just a more automatic/nicer way to do: > | > |module Moo > | def self.included mod > | mod.extend ClassMethods > | end > | module ClassMethods > | def cm > | end > | end > | def im > | end > |end > | > |class Foo > | include Moo > |end > | > |? > > Maybe. I am not opposing to this style. > > |It does seem a bit more convenient. > > How is it more convenient? > I mean your proposal seems more convenient than the common idiom I showed. Phil