Archive for June, 2006

K notes

Tuesday, June 6th, 2006

K is a terse array-oriented programming language.

Download old, free interpreter here

Here’s an intro

My notes, so far. Note that “monadic” means the operator takes one argument (! 10); dyadic means it takes two (2 ! 10).

~ monadically is NOT.
_ is the monadic trunc operator. _ 10 = 10, _ 10.9 = 10
! is the dyadic mod operator. 100 ! 2 = 0, 101 ! 2 = 1
| (pipe) is the monadic array reverse operator. | 1 2 3 = 3 2 1
? monadically is the array uniq operator. ? 1 2 3
1 2 3
? 1 2 3 1
1 2 3

@ is the dyadic array index operator. names: `tom `bob `frank
names @ 0
`tom
names @ …