On 9/12/07, Joachim Baumann <
joachim.baumann@...> wrote:
> Hi James,
>
> first of all, never having met you, let me say: A big thanks for
> inventing Groovy, even if you went on to greener (or at least other)
> pastures. :-)
Thanks! just different pastures...
> You can add your own metaclasses by simply placing them in the right
> spot. Here is an example:
Aha! I knew there must have been a nice way to do this! Many thanks!
FWIW I still prefer my option as an extra way of doing it; its
particularly useful for writing a whole bunch of new methods on
multiple types in a single simple class; but see the attraction of the
other method too.
I did try using your approach but it only seems to work for the end
class, not any base classes. I basically wanted to add methods to base
classes (e.g. think of adding methods to java.lang.Object). So I still
think there's merit in my approach as well.
--
James
-------
http://macstrac.blogspot.com/---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email