Groovy Roadmap

Posted by Warner Onstine Thu, 20 Dec 2007 23:36:36 GMT

So Guillaume posted the current road map to the list a couple of days ago and I put in my .02 for fixing the (in my eyes) broken operator overloading. And the bug I really wanted is now marked to be fixed in 1.6!

I honestly can’t say how happy I am at this and will definitely test this functionality out with my Math DSL that I am working on.

Overriding the 'as' operator 2

Posted by Warner Onstine Thu, 06 Dec 2007 16:40:25 GMT

A friend of mine sent me a link to Charles Nutter’s blog on implementing interfaces using the as operator. While I was explaining how it worked to him I remembered that like many operators you can also override this one using asType(). This got us to thinking when would you use this functionality?

I have one project I’m working on right now (not ready to talk yet about as I want more code in place before I unveil it, :-P) but this might be useful. Say that you wanted to duck-type your object for specific class instances. Overriding as may be one place to do it.

When would this make sense? Personally I think something like this makes the most sense in a library that provides some kind of functionality to a bunch of classes (rather than a one-off case). But I’m curious to see how others have used this functionality, would help to shed some light on other uses I hadn’t thought of.