cancel
Showing results for 
Search instead for 
Did you mean: 

how do I read this k function

analyst_tech_jo
New Contributor
how do I read this k function and where do I find documenation for k


q)parse "til"
k){$[0>@x;!x;'`type]}

2 REPLIES 2

rory_ororke
New Contributor
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, help`verb 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 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 > wrote:>>>> how do I read this k function and where do I find documenation for k>>>>>> q)parse "til">> k){$[0>@x;!x;'`type]}>>>> -->> You received this message because you are subscribed to the Google Groups>> "Kdb+ Personal Developers" group.>> To unsubscribe from this group and stop receiving emails from it, send an>> email to personal-kdbplus+unsubscribe@googlegroups.com.>> To post to this group, send email to personal-kdbplus@googlegroups.com.>> Visit this group at https://groups.google.com/group/personal-kdbplus.>> For more options, visit https://groups.google.com/d/optout.>>> --> You received this message because you are subscribed to the Google Groups> "Kdb+ Personal Developers" group.> To unsubscribe from this group and stop receiving emails from it, send an> email to personal-kdbplus+unsubscribe@googlegroups.com.> To post to this group, send email to personal-kdbplus@googlegroups.com.> Visit this group at https://groups.google.com/group/personal-kdbplus.> For more options, visit https://groups.google.com/d/optout.-- Aaron Daviesaaron.davies@gmail.com