"T. Onoma" <transami / runbox.com> schrieb im Newsbeitrag
news:200408160908.33287.transami / runbox.com...
> On Monday 16 August 2004 05:11 am, Robert Klemme wrote:
> > What made you change your mind?  I mean, this is exactly what I
suggested
> > in the first place.
>
> Sorry, I probably wasn't clear enough. It wasn't so much that I changed my
> mind, as I just decided that I prefer the methods at the instance level.
The
> difference between this:
>
>   module Foo
>     class << eval
>       def foo
>         ...
>       end
>     end
>   end
>
> And this
>
>   module Foo
>     def foo
>       ...
>     end
>   end
>
> At first I was trying to get the former's class-level method to be "class
> inheritable" on include (which is what your example succeeds at quite
> nicely). But now I'm thinking I like using the later better b/c the code
is
> more reusable in that form.
>
> That's all I meant. I'm still doing the same thing --using a module in a
> module. Although I'm not modifying the Module class itself to do the work
> anymore.

So, if I do understand correctly, basically you decided that all "functions"
(i.e. methods you implemented in the module singleton) could go into
instances as well.  You probably put them into the module singleton class
because they encapsulated some algorithm that needed no instance state
(hence "functions").

> Hmmm...That makes me wonder. Who has found a NECESSARY use for modules
that
> have BOTH mixable methods AND class-level methods?

All scenarios where that require a per class bookkeeping of what instances
do, which you apparently didn't need.

    robert