Per each prior ; the definition says v2 ( dyad verb) then how the does the monad below work ?
f:{:(~)x} / unary function
({(~)x}‘:) 0 1 2 3 / output is 1000b
({(~)x}’:) (,)0 /output is enlist 1b
Per each prior ; the definition says v2 ( dyad verb) then how the does the monad below work ?
f:{:(~)x} / unary function
({(~)x}‘:) 0 1 2 3 / output is 1000b
({(~)x}’:) (,)0 /output is enlist 1b
That’s also parallel each, i.e. the k adverb is overloaded. It has different keywords in q for the monadic and dyadic case:
q) prior ~ peach
1b
András
': means peach when applied to monadic functions https://code.kx.com/q/ref/maps/#each-parallel.
So what you have is:
not peach 0 1 2 3
not peach enlist 0
This is not each prior in this case, it is each-parallel/peach. And if you don’t have slaves configured the each-parallel is likely defaulting to each. Same as
q)not each 0 1 2 3
1000b
You can confirm it’s an each-parallel by attempting to set a global (with slaves enabled):
q)({`a set 1;(~)x}':)0 1 2 3
'noupdate: .
a
[1] (.q.set)
[0] {`a set 1;(~)x}
^
Terry