I can't speak for central tenets of the Groovy language, but I know
that == is not used for object identity ("is" is) in Groovy. In fact,
that's the poster child for Groovy's "not quite Java"-ness.  I think
the approach of keeping compatibility with the general form of Java,
while adding flexibility, has been a good one for Groovy, as it allows
Java developers to be productive quickly.

http://groovy.codehaus.org/Differences+from+Java

On Jan 14, 9:46 am, Reinier Zwitserloot <[email protected]> wrote:
> A long time ago, when I read about groovy, I remember reading about a
> central tenet of the groovy language being: Existing java language
> should also be valid groovy.
>
> This struck me as pretty dumb at the time, and still does: There are
> plenty of weird things in java which I *really* don't want to see
> repeated in another language, such as '==' being used for object
> identity (an operation absolutely nobody ever uses - something that
> CLEARLY should have been offloaded to System.objectsAreIdentical(a, b)
> or some such).
>
> I also know it's not actually true (the equals(SomehingThatIsntObject)
> java puzzler would actually work as you expect in groovy, because
> groovy effectively uses reflection to handle every call, at least in
> spirit, whereas java only checks the type and 'hardcodes' the target
> method, but that means that java code run as groovy code isn't exactly
> equal).
>
> Is this still the case?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to