jaq
jaq copied to clipboard
foreach not supported?
See:
oguz@LAPTOP-KKDLALF8:~$ jaq -n 'foreach . as $x (.; .; .)'
Error: Unexpected token while parsing string, expected =, [, and, <=, //, %=, -, %, +, /=, *=, ,, or, *, >=, |=, !=, ==, ", >, ?, |, +=, /, as, <, ), -=
╭─[<unknown>:1:22]
│
1 │ foreach . as $x (.; .; .)
│ ─┬
│ ╰── Unexpected token ;
───╯
oguz@LAPTOP-KKDLALF8:~$
Is foreach
not supported? What am I doing wrong?
See end of this section https://github.com/01mf02/jaq?tab=readme-ov-file#folding about foreach/3
@wader Thanks. Why advertise it as a jq clone and waste people's time though?
@oguz-ismail, I'm sorry to hear that you feel like your time has been wasted. However, jaq implement a sufficiently large set of jq features that I think that it warrants the name "jq clone". Furthermore, most "clones" are not completely identical to their originals, otherwise what would the point of a clone be?
I guess that some heuristics to warn when foreach/3 is used could have partially prevented your problem. However, I do currently not have the resources to implement such heuristics.
@01mf02 - Maybe "dialect" would help avoid confusion. That seems to be the compromise in the wikipedia article on jq.