You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 26, 2022. It is now read-only.
In value |> ?.foo, ?. is tokenised as a single token (OptionalChainingPunctuator) so can't be resolved into ? and . by the grammar.
Using a "unary operator" for this case is a possible workaround, but it's not straightforward because ?.foo matches the extant OptionalChain production. And you've still got to allow for ? . value or (?).value. (If it wasn't for this case, you could just add ? to PrimaryExpression and then disallow it outside a pipeline.)
Also value |> ?.foo?.bar seems pretty confusing. So, as much as I love ?, it's probably the wrong character. (?% isn't a legal expression or a token...)
Other than that, count me as TeamHack. This proposal achieves left to right function evaluation, which is the main goal. And I think making value |> foo(?) look like a function is a gain - the first time you see it, you'll have a good guess at what's going on.