Skip to content
Fenhl edited this page Apr 7, 2015 · 1 revision

Filters are the basic building blocks of the jqsh language. Each node of the syntax tree is a filter.

A filter can be run on a channel, which then becomes its input. The filter may pop values off the input as they become available or at its own pace, until the channel is terminated. It may also examine the channel's namespaces and context. The filter also produces an output channel whose namespaces and context it must configure. It may push values into the output channel or eventually terminate it. The output channel can be read from outside.

When a filter is typed into a jqsh repl, it receives an empty channel as its input, and its output is processed by the shell to be displayed back at the user.

Some filters take other filters as attributes at construction (parsing) time. For example, the filter 1 + 2 is a plus operator filter that takes the filters 1 and 2 as attributes. Most filters run their attribute filters in parallel.

Clone this wiki locally