Conversation
This should close #289.
|
For strange inputs, it may be better to report errors This is jq implement: def join($x): reduce .[] as $i (null;
(if .==null then "" else .+$x end) +
($i | if type=="boolean" or type=="number" then tostring else .//"" end)
) // "";Also, the implementation of jq can input object Examples: $ jq -n '[1,2,null,3,true]|join(",")'
"1,2,,3,true"
$ jq -n '{x:2,y:3}|join(",")'
"2,3"
$ jq -n '{}|join(",")'
""
$ jq -n '[[0],[1]]|join(",")'
jq: error (at <unknown>): string ("") and array ([0]) cannot be added |
I do not agree, because it makes the filter harder to describe and thus to understand.
To quote the jq manual about
So even if jq supports objects as input to Just so that you understand my goal with jaq; it is not to implement every implementation-specific detail of I am sympathetic to making changes to jaq's behaviour if somebody points me to a concrete instance where its behaviour hurts performance or usability. But I do not intend to reproduce all jq behaviour perfectly. Especially not undocumented or --- in my opinion --- outright confusing cases. In your case, for example, unless you convince me why |
This should close #289.