Skip to content

Function parsing with pipe #4290

Answered by max-sixty
broneill asked this question in Q&A
Mar 1, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Yes, the rules around parentheses are some of my least favorite rules. Check out https://prql-lang.org/book/reference/syntax/operators.html#parentheses...

The reason we can't always loosely bind = so that let a = 3 | math.pow 2 parses to let a = & 3 | math.pow 2 is because that would parse join foo=bar (==id) to join foo= & bar (==id), which isn't right. If we had different syntax for aliases vs. assignments, then we could bind = in the first example tighter, and require fewer parentheses.

But this was the best tradeoff we could come up with. (Lots of old issues on this that are required context to make progress here...)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@broneill
Comment options

@max-sixty
Comment options

@broneill
Comment options

Answer selected by max-sixty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants