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

View: New views
3 Messages — Rating Filter:   Alert me  

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

by Daniel.Sun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

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

by Jochen Theodorou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


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

by Daniel.Sun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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