# K mode

**URL:** <https://forum.kx.com/t/k-mode/5951>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [February 20, 2009, 5:38pm UTC](https://forum.kx.com/t/k-mode/5951 "2009-02-20T17:38:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![annakh71](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@annakh71](https://forum.kx.com/u/annakh71)\
**Post date:** [February 20, 2009, 5:38pm UTC](https://forum.kx.com/t/k-mode/5951/1 "2009-02-20T17:38:00Z")

</div>

Is there a way to start q with k mode as the default, so as not tohave to prefix every k statement with “k)” ? I don’t see it under thecommand line options. Incidentally the “k)” feature should be betterdocumented: I intuited it on a hunch after reading about “s)” but Ihad looked everywhere for it in vain before.And where is K4 (now relegated to “bootstrap language” status)documented?

---

<div class="post-metadata">

**Author:** ![Attila](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Attila](https://forum.kx.com/u/Attila)\
**Post date:** [February 20, 2009, 8:43pm UTC](https://forum.kx.com/t/k-mode/5951/2 "2009-02-20T20:43:00Z")

</div>

X-Mailer: Apple Mail (2.930.3)\ toggles between k and q modeq)\ /you start in k !10 /you are in k now \ /want to go back to qq)til 10 /back to qa file with extension k will be interpreted as kk4 is not documented, it can be thought of as a subset of q with more symbols and slightly different parsing rules AttilaOn 20 Feb 2009, at 17:38, annakh7 wrote:\>\> Is there a way to start q with k mode as the default, so as not to\> have to prefix every k statement with “k)” ? I don’t see it under the\> command line options. Incidentally the “k)” feature should be better\> documented: I intuited it on a hunch after reading about “s)” but I\> had looked everywhere for it in vain before.\>\> And where is K4 (now relegated to “bootstrap language” status)\> documented?\>\> \>

---

<div class="post-metadata">

**Author:** ![annakh71](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@annakh71](https://forum.kx.com/u/annakh71)\
**Post date:** [February 21, 2009, 2:08am UTC](https://forum.kx.com/t/k-mode/5951/3 "2009-02-21T02:08:00Z")

</div>

Thanks. I had hit upon \ many times (typos) and noticed that another \seemed to restore thing to normal but had not understood what I hadstumbled upon.It’s a pity k4 is not documented. Since it is exposed and usable thereshould be at least documentation, in the style of the abridged Qreference.

---

<div class="post-metadata">

**Author:** ![annakh71](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@annakh71](https://forum.kx.com/u/annakh71)\
**Post date:** [February 21, 2009, 2:09am UTC](https://forum.kx.com/t/k-mode/5951/4 "2009-02-21T02:09:00Z")

</div>

“at least basic documentation”, I meant to write

---

<div class="post-metadata">

**Author:** ![trieder](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@trieder](https://forum.kx.com/u/trieder)\
**Post date:** [February 21, 2009, 5:51pm UTC](https://forum.kx.com/t/k-mode/5951/5 "2009-02-21T17:51:00Z")

</div>

You can find some very good K3/K4 documentation on the web in PDF format. I can’t recall where I found it though. As far as I recall, Kx recommends new developers use q, not that learning k is a bad thing in itself. You can also figure out k code by reading q.k. Once you know what particular q functions do, you can learn the k equivalent by looking it up in q.k or typing it in q itself. i.e. try typing “til” on the q prompt and then press enter.

---

<div class="post-metadata">

**Author:** ![annakh71](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@annakh71](https://forum.kx.com/u/annakh71)\
**Post date:** [February 22, 2009, 11:43pm UTC](https://forum.kx.com/t/k-mode/5951/6 "2009-02-22T23:43:00Z")

</div>

There are enough changes from K3 to K4 that K3 docs don’t really cutit. You can indeed infer a good deal of it from other sources but anauthoritative K4 reference would be better.I already know K3, so I find K4 more appealing than Q. I don’t see whyK had to be kinda deprecated all in a sudden and why Q functionalitycouldn’t be offered as a library of verbs instead of as a whole newlanguage: first, it is rude to the people who put in the time to learnK in the past and, second, Q rather detracts (IMO) from the appeal ofthe product because it is less elegant than K: both on account of itsverbosity (and yes I know that was probably the point) and because ofirritating quirks like the following.In both K4 and Q, `:file.txt 0: ("aaa";"bbb") will write the strings(lines) to file.txt but in the other direction "0: `:file.txt"apparently works only in K4: in Q you have to use read0 instead; thusthere is no symmetry between read and write. Now, if you want to hide0:, at least do it consistently: by providing both write0 and read0verbs in Q, otherwise don’t hide it. K was free from such warts andlikely still is.

---

<div class="post-metadata">

**Author:** ![charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@charlie1](https://forum.kx.com/u/charlie1)\
**Post date:** [February 23, 2009, 12:10am UTC](https://forum.kx.com/t/k-mode/5951/7 "2009-02-23T00:10:00Z")

</div>

q)(read0 `:file.txt)~(0:) `:file.txt

1b

q is not ambivalent.

to get monadic 0: you can force the binding with ()

---

<div class="post-metadata">

**Author:** ![Aaron\_Davies](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@Aaron\_Davies](https://forum.kx.com/u/Aaron_Davies)\
**Post date:** [February 23, 2009, 12:41am UTC](https://forum.kx.com/t/k-mode/5951/8 "2009-02-23T00:41:00Z")

</div>

the unifying principle is that all k4 symbolic monadics became english words in q

dyadics stayed symbolic

---

<div class="post-metadata">

**Author:** ![pierre](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pierre](https://forum.kx.com/u/pierre)\
**Post date:** [February 23, 2009, 7:38am UTC](https://forum.kx.com/t/k-mode/5951/9 "2009-02-23T07:38:00Z")

</div>

In-Reply-To: \<32bf96e80902210951x140371cei2a8f4d86c626830e@mail.gmail.com\>User-Agent: Mutt/1.5.17+20080114 (2008-01-14)X-Google-Approved: [charlie@kx.com](mailto:charlie@kx.com) via web at 2009-02-23 11:16:22On Sat, Feb 21, 2009 at 12:51:28PM -0500, Tim Rieder wrote:\> You can find some very good K3/K4 documentation on the web in PDF format. I\> can’t recall where I found it though. Hello, I’m very interested in K3/K4 docs, but unfortunately I couldn’t findthem on the web. Could you please share them or perhaps give a slighthint on how to find them?With best regards, – pierre

---

<div class="post-metadata">

**Author:** ![Aaron\_Davies](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@Aaron\_Davies](https://forum.kx.com/u/Aaron_Davies)\
**Post date:** [February 23, 2009, 2:48pm UTC](https://forum.kx.com/t/k-mode/5951/10 "2009-02-23T14:48:00Z")

</div>

http://kx.com/a/k may have something useful in it

if you’re a licensed user, there have been k3 docs in the full version d/l site at times

On Mon, Feb 23, 2009 at 3:38 PM, pierre \<k.pierre.k@gmail.com\> wrote:

> On Sat, Feb 21, 2009 at 12:51:28PM -0500, Tim Rieder wrote:  
> \> You can find some very good K3/K4 documentation on the web in PDF format. I  
> \> can’t recall where I found it though.
> 
> Hello,
> 
> I’m very interested in K3/K4 docs, but unfortunately I couldn’t find  
> them on the web. Could you please share them or perhaps give a slight  
> hint on how to find them?
> 
> ## With best regards,
> 
> pierre

–  
Aaron Davies  
aaron.davies@gmail.com
