Yukihiro Matsumoto wrote:
> Hi,
>
> In message "Re: Why the lack of mixing-in support for Class methods?"
>     on Sun, 11 Jun 2006 22:43:11 +0900, transfire / gmail.com writes:
>
> |As you say, meta-programming can take care of it, but the biggest
> |problem with meta-programming approaches is that everyone is using
> |there own variation.
>
> Don't get me wrong.  I didn't say that I wouldn't do nothing, and let
> you help yourself using meta-programming features.  I'd happy to add
> the standard feature to achieve your goal, if it really is a generic
> requirement.

> I like the solution that Daniel has shown in [ruby-talk:196730].

He he. That's ironic. Yes, Daniels solution is the right direction for
the best meta-programming approach, but it still has some problems (as
I pointed out in my last post).

> The point is I want to make sure which approach is the way to go.

Ah, I see. Cool. Well, Maybe that approach is the best way then. You
can look at Facets, classmethod.rb or classinherit.rb for a full
rendition of that techinque. The two are identical, BTW. They just
differ in terminology (though I'm now thinking 'extensible' might be a
much better term).

On the other hand, I can't help but wonder if a module's "class-level"
were instead a "module-level", --a module instead of a class. Or at
least if those methods were delegated to an extending module but
transaprently, underthehood. Then this might actually make sense:

  module M
    module << self
      ...
    end
  end

And it would be easy enough to write:

  def include_and_extend( mod )
    include mod
    extend (module << mod; self; end)
  end

An interesting thought.

Thanks,
T.