The
k programming language is an
APL derivative that uses the
ASCII character set. Since
ASCII is slightly less
self-documenting than the original
APL character set, this is a reference for the important symbols of
k.
Verbs:
- @ monadic: atom; dyadic: at; special: amend
- . monadic: evaluate, dictionary; dyadic: of; special: amend at depth
- + monadic: flip, transpose; dyadic: plus
- - monadic: negate; dyadic: minus
- * monadic: first; dyadic: times
- % monadic: reciprocal; dyadic: divided by
- ! monadic: enumerate; dyadic: mod, rotate
- ^ monadic: shape; dyadic: power
- | monadic: reverse; dyadic: max, or
- & monadic: where; dyadic: min, and
- < monadic: grade up; dyadic: less than
- > monadic: grade down; dyadic: more than
- # monadic: count; dyadic: reshape, take
- _ monadic: floor; dyadic: drop, cut
- , monadic: enlist; dyadic: join
- ~ monadic: not; dyadic: match
- = monadic: group; dyadic: equal
- ? monadic: range, unique; dyadic: find, inverse
- $ monadic: format; dyadic: form
Adverbs:
- ' each; example: *'x; ``first each x''...the first element of each member of x
- \: each left; example: x+\:y; ``x plus each left y''...add each element in x to y, returning each sum.
- /: each right; example: x+/:y; ``x plus each right y''...add each element in y to x, returning each sum.
- ': each pair; example: +':x; ``plus each pair x''...sums of all adjacent pairs in x
- / over; example: +/x; ``plus over x''...add all x, accumulating results
- \ scan; example: +\x; ``plus scan x''...add all x, accumulating results and returning a running sum after each