how do I read this k function and where do I find documenation for k
q)parse “til”
k){$[0>@x;!x;'`type]}
how do I read this k function and where do I find documenation for k
q)parse “til”
k){$[0>@x;!x;'`type]}
It reads
If type x is < 0 (@x) run til x (!x) else signal `type.
Interestingly ! in k matches the .q.key which explains
q)(key 10)~til 10
1b
As for resources not to sure where to go. you can start by looking at q.k to get a feel for it.
Thanks Rory
there isn’t much documentation for k4 availableif you have help.q loaded, helpverb is a good place to start itgives you the monadic meanings of the punctuation functions (! is key,@ is type, etc.)you can also search .q for the functions that are direct aliases tomonadic punctuation:{(where 101h=type each x)#x}.qthe rest of k is mostly slightly different parsing rules (nounderscores allowed in sym literals, newlines act as semicolons, the.q namespace isn't special, enlist isn't really the same as monadiccomma, etc.) and none of that is really documented anywhere afaikOn Mon, Dec 14, 2015 at 1:13 AM, 'Rory O'Rorke' via Kdb+ PersonalDevelopers <personal-kdbplus> wrote:> It reads> If type x is < 0 (@x) run til x (!x) else signal
type.> Interestingly ! in k matches the .q.key which explains>> q)(key 10)~til 10> 1b>> As for resources not to sure where to go. you can start by looking at q.k to> get a feel for it.>> Thanks Rory>> On Mon, Dec 14, 2015 at 12:31 PM, analyst <analyst.tech.jobs>> wrote:>>>> how do I read this k function and where do I find documenation for k>>>>>> q)parse “til”>> k){$[0>@x;!x;'`type]}>>>> –>>
Submitted via Google Groups</analyst.tech.jobs>