Please do not post any internal, closed source snippets on this public issue tracker!
Description
The fallback syntax a.b?:c (get b in a if it exists else fall back to c) only works if a is not blank. .b works if b is present in the local scope of ., but .b?:c does not.
However it works if the question mark follows a deeper symbol:
rrai eval '(a: (b: 1)) -> .a.b?:0'
1
Expected behavior
arrai eval '(a: 1) -> .b?:0'
0
Your Environment
$ arrai info
Version : DIRTY-v0.107.0
Git commit : 9b0f4570f8bc49a89650907b806e02f014e887d6
Date : 2020-08-02T05:15:55Z
OS/arch : darwin/amd64
Go version : go1.14.4 darwin/amd64
Please do not post any internal, closed source snippets on this public issue tracker!
Description
The fallback syntax
a.b?:c
(getb
ina
if it exists else fall back toc
) only works ifa
is not blank..b
works ifb
is present in the local scope of.
, but.b?:c
does not.Workaround is to introduce a LHS:
\x x.b?:c
.Steps to Reproduce
However it works if the question mark follows a deeper symbol:
Expected behavior
Your Environment