Please do not post any internal, closed source snippets on this public issue tracker!
Description
The fallback operator doesn't seem to work when buried inside a dot expression.
Situation: I have a nested tuple, sometimes (a: (z: 1)) and sometimes (b: (z: 1)). Whether it's a or b, I want to look up the value of z. Essentially `(...).(a || b).z.
$ arrai eval 'let t = (b: (z: 1)); (t.a?:b).z' # symbol "b" is not in scope, fair enough.
INFO[0000] name "b" not found in {t}
$ arrai eval 'let t = (b: (z: 1)); (t.a?:.b).z' # ".b" should work if the fallback scope is the same as when the lookup failed (i.e. inside t).
INFO[0000] unconsumed input
$ arrai eval 'let t = (b: (z: 1)); (t.a?:t.b).z' # "t.b" should work if the fallback scope is the same as before the lookup failed (i.e. outside t). In this case, it does work.
1
$ arrai eval 'let t = (b: (z: 1)); (t.b?:t.a).z' # If that was valid syntax, then this should be too. However, if "t.b" does exist, then "?:t.a" is illegal for some reason.
INFO[0000] Missing attr "a" (available: |z|)
Expected behavior
Something should work consistently, either ?:.b or ?:t.b.
Actual behavior
Fails as above.
Your Environment
$ arrai info
Version : v0.108.0
Git commit : 088eb761421461b3db03fffa589d94ff0914f638
Date : 2020-08-03T05:27:09Z
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 operator doesn't seem to work when buried inside a dot expression.
Situation: I have a nested tuple, sometimes
(a: (z: 1))
and sometimes(b: (z: 1))
. Whether it'sa
orb
, I want to look up the value ofz
. Essentially `(...).(a || b).z.Expected behavior
Something should work consistently, either
?:.b
or?:t.b
.Actual behavior
Fails as above.
Your Environment