cancel
Showing results for 
Search instead for 
Did you mean: 

Re: [personal kdb+] Using apply (.) with a binary verb

felix1
New Contributor
> can somebody explain to me why I need parentheses around the binary verb %> when I am using it with apply.......> And then why do I have to use parentheses for "or over" in q while in k I> dont need themthe q parser is separate from the k4 one and it is dumber. it doesn'tunderstand multivalence (% is both a monadic and dyadic function).
2 REPLIES 2

Attila
New Contributor
%.(6 3)
or
%. 6 3
in q
is
reciprocal value 6 3
which does not make much sense

.6 3 is a float vector
.(6 3) is the verb . and an int vector

you need parentheses around % to make it a noun from a verb

Cheers,
  Attila

sieber
New Contributor
Hi,
thank you, I think I got it now.

% in k is both a verb "6%3" and a noun "%3".  In Q these built-in verbs are always used as verbs and never as noun, so "%3" in q gives an error. With the
parentheses I tell the q-interpreter, that I want to use % as noun.  Correct?

So Q can't differentiate between the verb and noun form of the built-in while K can. Correct?

Same goes for | in k which can be used as verb and noun. The or is | and in order to use it as a noun in q I need parentheses and the over adverb in Q needs a noun not a verb. Correct?

thank you!
Markus