Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Currently in order to make a null safe property navigation, the syntax is ?nullSafeProperty.property
For example, foo.?bar.p
means foo.bar == null ? null : foo.bar.p
There are many scripting language adopting a different syntax: ?.
The above example becomes: foo.bar?.p
which is more intuitive because
1) the null-checking
is put together with the corresponding navigation (.) . Existing syntax of MVEL is a bit misleading because .? seems to come together, but in fact the latter ? affects the next navigation.
2) The syntax (?.) can be easily understand by "reading" as : is not null
then navigate (.)
It seems to me both syntax can coexists in order to maintain backward compatibility.
For example
foo.?bar.apple?.?boy.car
seems interpretable.
JIRA is converting ( ? ) to an icon
.. Please interpret all red question mark icon
as ( ? )