add identity syntax 'foo === bar' which is same as 'foo.is(bar)'

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

add identity syntax 'foo === bar' which is same as 'foo.is(bar)'

Daniel Sun
Hi, I am a Groovy fan. Now I'm reading 'Groovy in action'. In Groovy, If you really need the identity, you can use the method "is" like foo.is(bar). Don't you think foo === baris more concise than the former? The new syntax is inspired by JavaScript. Thanks, Daniel.Sun
Reply | Threaded
Open this post in threaded view
|

Re: add identity syntax 'foo === bar' which is same as 'foo.is(bar)'

Jochen Theodorou
Daniel.Sun schrieb:
> Hi, I am a Groovy fan. Now I'm reading 'Groovy in action'. In Groovy, If
> you really need the identity, you can use the method "is" like
> *foo.is(bar)*. Don't you think *foo === bar*is more concise than the
> former? The new syntax is inspired by JavaScript. Thanks, Daniel.Sun
> View this message in context: add identity syntax 'foo === bar' which is
> same as 'foo.is(bar)'

we had the === but we decided it looks too much like ==, so we ditched it.

bye blackdrag

--
Jochen "blackdrag" Theodorou
Groovy Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: add identity syntax 'foo === bar' which is same as 'foo.is(bar)'

Daniel Sun
OK, I See. Thank you :-)
Jochen Theodorou wrote
Daniel.Sun schrieb:
> Hi, I am a Groovy fan. Now I'm reading 'Groovy in action'. In Groovy, If
> you really need the identity, you can use the method "is" like
> *foo.is(bar)*. Don't you think *foo === bar*is more concise than the
> former? The new syntax is inspired by JavaScript. Thanks, Daniel.Sun
> View this message in context: add identity syntax 'foo === bar' which is
> same as 'foo.is(bar)'

we had the === but we decided it looks too much like ==, so we ditched it.

bye blackdrag

--
Jochen "blackdrag" Theodorou
Groovy Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email