Elvis Operator

21 views
Skip to first unread message

Sean Daniels

unread,
May 23, 2013, 2:45:21 PM5/23/13
to ra...@googlegroups.com
I assume there is a good reason why you can't do:

name = contact.getName() ?: 'Unavailable'

The code above throws "left operant of the Elvis operator has to be a variable declaration". Is there any way to remove this limitation?

Igal @ getRailo.org

unread,
May 23, 2013, 3:15:31 PM5/23/13
to ra...@googlegroups.com
please open a ticket for this in the JIRA.

thanks
--
Igal Sapir
Railo Core Developer
http://getRailo.org/

Chris Blackwell

unread,
May 23, 2013, 3:37:59 PM5/23/13
to railo
interestingly, if you enable "magic getters" you can do

name = contact.name ?: 'Unavailable'

so this is probably just a syntax parser issue



--
Did you find this reply useful?  Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki


If you don't have time, add a request to the Railo Server wiki to-do page at https://github.com/getrailo/railo/wiki/Todo
---
You received this message because you are subscribed to the Google Groups "Railo" group.
For more options, visit https://groups.google.com/groups/opt_out.



Sean Daniels

unread,
May 24, 2013, 8:44:48 AM5/24/13
to ra...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages