wader/jqjq

Intrinsics take precedence over user-overloaded filters

thaliaarchi opened this issue · 1 comments

Filters, that are passed through to jq, take precedence over user-defined filters of the same signature. This does not match jq behavior. Here's an example comparing debug, which is an intrinsic, and first, which is a builtin.

$ jqjq -n 'def debug: 42; debug'
["DEBUG:",null]
null
$ jq -n 'def debug: 42; debug'
42
$ jqjq -n 'def first: 42; first'
42
$ jq -n 'def first: 42; first'
42
wader commented

Oh hmm i guess the order of looking up things in def _func: needs to change. Currently user-defined is in the last else, should be first somehow i guess and only the undefined_func stuff in the else. That function is quite a beast also, maybe could be refactored somehow?