On Apr 4, 12:06 pm, Trans <transf... / gmail.com> wrote:

> Hmmm... I don't think that's right. These choices assume the viewpoint
> that these are methods first, but rather I say they ought to be
> constants first.
>
> To give you better idea of what I mean, your example made me think of:
>
>   module M
>
>      Clobber = lambda {}
>
>      Const = 42
>
>      def self.included other
>
>        :nothing
>
>      end
>
>   end
>
>   class C
>
>      include M
>
>   end
>
> Which is essentially the functionality desired, with the one exception
> that the same name could be used for a class/module constant and a
> method constant -- the () would differentiate which is meant.

Actually, there is another exception (and perhaps you were meaning
this?) That 'self' within the method would be the execution context,
but with the lambda it is the defining module context. So my example
isn't as equivalent as I first thought. Too bad.. But it does convey
the "constant first" idea I was getting at.

T.