Reference/Adverb

From Kx Wiki
Jump to: navigation, search

301 Permanent move

This article is now at code.kx.com/q/ref/adverbs/

Please update your bookmark. The old wiki will remain here for a while. If you prefer it to the new format, please tell the Librarian why.

Adverbs

An adverb is any function where the x parameter is a function. The primitive adverbs are ' / \ ': /: \:.

symbol name
' each
/ over
\ scan
': prior
/: each right
\: each left

For convenience, q defines the adverbs each, over, scan and prior (corresponding to the adverbs ' / \ ':).

There should be no whitespace between a primitive adverb and its x argument when using the form x/, x', etc

Example

q)reverse (1 2 3;"hello")
"hello"
1 2 3

q)reverse each (1 2 3;"hello")        / adverb each
3 2 1
"olleh"
q)1 2 3 , 100 200 300
1 2 3 100 200 300

q)1 2 3 ,' 100 200 300                / adverb ' (each-both)
1 100
2 200
3 300

See also

each, over, scan and prior

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox