Skip to content

Reference card

Keywords

Aabs acos aj aj0 ajf ajf0 all and any asc asin asof atan attr avg avgs
Bbin binr
Cceiling cols cor cos count cov cross csv cut
Ddelete deltas desc dev differ distinct div do dsave
Eeach ej ema enlist eval except exec exit exp
Ffby fills first fkeys flip floor
Gget getenv group gtime
Hhclose hcount hdel hopen hsym
Iiasc idesc if ij ijf in insert inter inv
Kkey keys
Llast like lj ljf load log lower lsq ltime ltrim
Mmavg max maxs mcount md5 mdev med meta min mins mmax mmin mmu mod msum
Nneg next not null
Oor over
Pparse peach pj prd prds prev prior
Rrand rank ratios raze read0 read1 reciprocal reval reverse rload rotate rsave rtrim
Ssave scan scov sdev select set setenv show signum sin sqrt ss ssr string sublist sum sums sv svar system
Ttables tan til trim type
Uuj ujf ungroup union update upper upsert
Vvalue var view views vs
Wwavg where while within wj wj1 wsum
Xxasc xbar xcol xcols xdesc xexp xgroup xkey xlog xprev xrank

.Q.id (sanitize), .Q.res (reserved words)

Operators

@
.
Apply
Index
Trap
Amend
$Cast
Tok
Enumerate
Pad
mmu
!Dict
Enkey
Unkey
Enumeration
Flip Splayed
Display
internal
Update
Delete
?Find
Roll, Deal
Enum Extend
Select
Exec
Simple Exec
Vector Conditional
+Add -Subtract *Multiply %Divide
=
<>
Equals
Not Equals
<
<=
Less Than
Up To
>
>=
Greater Than
At Least
~Match
| Greater, OR & Lesser, AND
#Take
Set Attribute
_Cut
Drop
^Fill
Coalesce
,
'
Join
Compose

Overloaded glyphs

Iterators

maps accumulators ' Each, each, Case /: Each Right / Over, over ': Each Parallel, peach \: Each Left \ Scan, scan ': Each Prior, prior

Execution control

.[f;x;e] Trap : Return do exit $[x;y;z] Cond @[f;x;e] Trap-At ' Signal if while

Debugging

Other

` pop stack : assign 0 console 0: File Text . push stack :: identity 1, -1 stdout 1: File Binary \x system cmd generic null 2, -2 stderr 2: Dynamic Load \ abort global amend n, -n handle \\ quit q set view

() precedence [;] expn block {} lambda ` symbol (;) list argt list ; separator `: filepath ([]..) table

Attributes

g grouped p parted s sorted u unique

Set Attribute

Command-line options and system commands

file
\atables\rrename
-bblocked-s \ssecondary processes
\b \Bviews\Srandom seed
-c \cconsole size-t \ttimer ticks
-C \CHTTP size\tstime and space
\cdchange directory-T \Ttimeout
\ddirectory-u -U \uusr-pwd
-e \eerror traps-udisable syscmds
-E \ETLS server mode\vvariables
\ffunctions-w \wmemory
-g \ggarbage collection-W \Wweek offset
\lload file or directory\xexpunge
-l -Llog sync-z \zdate format
-o \oUTC offset\1 \2redirect
-p \plistening port\_hide q code
-P \Pdisplay precision\terminate
-qquiet mode\toggle q/k
-r \rreplicate\\quit

system
Command-line options, System commands, OS commands

Datatypes

ncnameszliteralnullinfSQLJava.Net
0*list
1bboolean10bBooleanboolean
2gguid160NgUUIDGUID
4xbyte10x00Bytebyte
5hshort20h0Nh0WhsmallintShortint16
6iint40i0Ni0WiintIntegerint32
7jlong80j or 00Nj
or 0N
0Wj
or 0W
bigintLongint64
8ereal40e0Ne0WerealFloatsingle
9ffloat80.0 or 0f0n0wfloatDoubledouble
10cchar1" "" "Characterchar
11ssymbol.``varcharStringstring
12ptimestamp8dateDtimespan0Np0WpTimestampDateTime (RW)
13mmonth42000.01m0Nm
14ddate42000.01.010Nd0WddateDate
15zdatetime8dateTtime0Nz0wztimestampTimestampDateTime (RO)
16ntimespan800:00:00.0000000000Nn0WnTimespanTimeSpan
17uminute400:000Nu0Wu
18vsecond400:00:000Nv0Nv
19ttime400:00:00.0000Nt0WttimeTimeTimeSpan
20-76enums
77anymap
78-9677+t – mapped list of lists of type t
97nested sym enum
98table
99dictionary
100lambda
101unary primitive
102operator
103iterator
104projection
105composition
106v'
107v/
108v\
109v':
110v/:
111v\:
112dynamic load

n: short int returned by type and used for casting, e.g. 9h$3
c: character used lower-case for casting and upper-case for Load CSV
sz: size in bytes
inf: infinity (no math on temporal types); 0Wh is 32767h
v: applicable value
RO: read only; RW: read-write

Nested types are 77+t (e.g. 78 is boolean. 96 is time.)

Cast $: where char is from the c column above char$data:CHAR$string

dict:`a`b!…
table:([]x:…;y:…)
date.(year month week mm dd)
time.(minute second mm ss)
milliseconds: time mod 1000

Namespaces

.h

Markup output for HTTP

.h.br linebreak .h.cd CSV from data .h.code code after Tab .h.d delimiter .h.fram frame .h.ed Excel from data .h.ha anchor .h.edsn Excel from tables .h.hb anchor target .h.hc escape lt .h.ht Marqdown to HTML .h.hr horizontal rule .h.hta start tag .h.iso8601 ISO timestamp .h.htac element .h.jx table .h.htc element .h.td TSV from data .h.html document .h.tx filetypes .h.http hyperlinks .h.xd XML .h.nbr no break .h.xs XML escape .h.pre pre .h.xt JSON .h.text paragraphs .h.xmp XMP

.h.he HTTP 400 .h.c0 web color .h.hn HTTP response .h.c1 web color .h.hp HTTP response pre .h.HOME webserver root .h.hy HTTP response content .h.logo Kx logo .h.sa anchor style .h.hu URI escape .h.sb body style .h.hug URI map .h.ty MIME types .h.sc URI-safe .h.val value .h.uh URI unescape

.j

De/serialize as JSON

.j.j serialize .j.k deserialize .j.jd serialize infinity

.m

Memory backed by files

.Q

Utilities: general, environment, IPC, datatype, database, partitioned database state, segmented database state, file I/O

General Datatype addmonths btoa b64 encode bt backtrace j10 encode binhex dd join symbols j12 encode base 36 def M long infinity f format ty type ff append columns x10 decode binhex fmt format x12 decode base 36 ft apply simple fu apply unique Database gc garbage collect chk fill HDB gz GZip dpft save table id sanitize dpfts save table with sym qt is table dsftg load process save res keywords en enumerate varchar cols s plain text ens enumerate against domain s1 string representation fk foreign key sbt string backtrace hdpf save tables trp extend trap qt is table ts time and space qp is partitioned u date based V table to dict v value Partitioned database state view subview bv build vp ind partitioned index Constants cn count partitioned table A uppercase alphabet MAP maps partitions a lowercase alphabet D partitions b6 bicameral alphanums par locate partition nA alphanums PD partition locations pd modified partition locns Environment pf partition field k version pn partition counts opt command parameters qp is partitioned w memory stats pt partitioned tables x non-command parameters PV partition values pv modified partition values IPC vp missing partitions addr IP address fps fpn streaming algorithm Segmented database state fs fsn streaming algorithm D partitions hg HTTP get P segments host hostname u date based hp HTTP post l load

File I/O Cf create empty nested char file Xf create file

.z

System variables, callbacks

System information Callbacks .z.a IP address .z.ac HTTP auth from cookie .z.b dependencies .z.bm msg validator .z.c cores .z.exit action on exit .z.D/d date shortcuts .z.pc close .z.e TLS connection status .z.pd peach handles .z.ex failed primitive .z.pg get .z.ey arg to failed primitive .z.ph HTTP get .z.f file .z.pi input .z.h host .z.po open .z.i PID .z.pp HTTP post .z.K version .z.pq qcon .z.k release date .z.ps set .z.l license .z.pw validate user .z.N/n local/UTC timespan .z.ts timer .z.o OS version .z.vs value set .z.P/p local/UTC timestamp .z.wc WebSocket close .z.pm HTTP options .z.wo WebSocket open .z.q quiet mode .z.ws WebSockets .z.s self .z.T/t time shortcuts .z.u user ID .z.W/w handles/handle .z.X/x raw/parsed command line .z.Z/z local/UTC datetime .z.zd zip defaults