[
https://issues.apache.org/jira/browse/JEXL-276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dmitri Blinov closed JEXL-276.
------------------------------
Resolution: Won't Do
> Introduce short-handed ternary operation x ? y
> ----------------------------------------------
>
> Key: JEXL-276
> URL: https://issues.apache.org/jira/browse/JEXL-276
> Project: Commons JEXL
> Issue Type: Improvement
> Affects Versions: 3.1
> Reporter: Dmitri Blinov
> Priority: Minor
>
> A short-handed ternary operation {{x ? y}} is an equivalent of the {{x ? y :
> null}}. The {{x : y}} operator is analogous to {{if (x) y}} statement with
> {{else}} part omitted. With new syntax we will have ternary operator and
> {{if}} statement to have full symmetry of forms, e.g.
> {{x ? y : x}} is {{if (x) y else z}}, {{x ? y}} is {{if (x) y}}
> Just to note, the proposed short-handed differs from Elvis operator {{x ?:
> y}} which is effectively {{x ? x : y}}. In other words, elvis operator allows
> for the middle part of the ternary operator to be omitted, whereas the
> proposed form allows for the imission of the last part.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)