On 7 April 2015 at 18:03, Nick Krempel <[email protected]> wrote: > On 6 April 2015 at 20:01, Jordan Harband <[email protected]> wrote: > >> If I want the short circuit in option 1, I'd do `a?.b?.c` to indicate >> that, whereas in option 2 if I don't want the short circuit, I'm forced to >> use separate variables. >> > > Worth noting that an option 1 `a?.b?.c` differs from an option 2 `a?.b.c` > in that the latter is effectively asserting that if a != null then its b > property is also != null, whereas the former is more lenient in what it > accepts. > > Also you are not forced to use separate variables in option 2, you can > just use parentheses: `(a?.b).c` - hence the whole discussion of lack of > transitivity (more correctly, associativity) for option 2. Or did I > misunderstand what you're trying to achieve? >
...but thinking about it further, wouldn't you always want the short circuit semantics? i.e. an option 1 `a?.b.c` is almost certainly a bug?
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

