You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dmitri Blinov (Jira)" <ji...@apache.org> on 2021/06/18 16:28:00 UTC

[jira] [Closed] (JEXL-276) Introduce short-handed ternary operation x ? y

     [ 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)