.Q.p function - what inputs?

Hello q folks, 
I was looking at the function definition for .Q.p, after seeing its usage in the billion taxi ride benchmark. 
k){$[~#D;p2[x;`:.]‘:y;(,/p2’/':Pi’y)@<,/y@:i:&0<#:'y:D{x@&x in y}:y]} - what inputs would this function take, as x and y?

Thanks, 

Kumar

| "" | Virus-free. www.avast.com |

I’m guessing y would be the contents of par.txt. Still trying to guess what x could be. 
Kumar

A word of caution from the top of code.kx.com/q/ref/dotq:

Reserved

The .Q namespace is reserved for use by Kx, as are all single-letter namespaces.

Consider all undocumented functions in the namespace as its private API – and do not use them.

Undocumented functions may disappear in later versions of the interpreter.

Best

Stephen




Stephen Taylor | Librarian | Kx | +44 7713 400852 | stephen@kx.com

Yes, Stephen, I came across the code in a blog post about the billion taxi ride benchmark, hence the question. Was just peering through it purely out of curiosity, I don’t intend to use the functions anywhere. 

Sincere regards, 

Kumar

To be frank, while already experienced with q, I sometimes hate the fact that such APIs are not properly documented. More often than not, we came across pieces of q code from the web (or, worst, from some error stack trace of our own code), and we needed to figure out what exactly was happening. But no, those are the holly “private functions” that you are NOT supposed to know! That creates heaps of unnecessary difficulties for someone who merely wants to understand a piece of running code.

Hmm - this brings up an important point

It used to be the case on the wiki that if something was missing we’d add it - specifically to the unreferences. It was and still is useful. The unreferences, at a time, were building out nicely, and personally I too like having the knowledge of what a function is supposed to do as it definitely does help. Back then though, we all thought it was just a just due to lack of documentation on the function, but now it seems that and/or due to it being ‘private’.

Would there be anything wrong with documenting all functions AND writing beside the ‘private’ ones “THIS IS FOR INTERNAL KDB+ USAGE ONLY”? .h does this - it details all/the majority of the .h functions but states “subject to changes” - it’s still very useful though.

@Stephen - if we are being told to not use/study/look at “undocumented” functions, it might be reasonable to do a full audit of all single letter namespaces and their functions and compare with what’s on the wiki[s]. As well as state what is for internal use and what isn’t.

Reason I say this - randomly looking - .Q.dbg isn’t listed at:

http://code.kx.com/q/ref/card/#q or http://code.kx.com/wiki/DotQ

Nor is .Q.Cf on either - but it can be found via searching - http://code.kx.com/q/ref/dotq/#qcf-create-empty-nested-char-file

Side note - if certain functions are definitely too sensitive/prone to changes and can’t be documented, would it be worthwhile hiding those only [again]? https://code.kx.com/q/ref/releases/ChangesIn2.4/#q-q-visibility