k programming language
a flavor of apl, i understand?
resources
notes from eris' k class
operator precedence: always from right to left.
types:
- integer (list of)
- float (list of)
- character (list of/string)
- dictionary (list of/table)
- symbol (list of)
lists are enclosed between parenthesis, and items separated with semicolons
equivalent to:
assignment is done with :
verbs
minus sign (-), unary is negate, binary is subtraction:
plus sign (+), binary is addition:
asterisk (*), unary is "first", binary is multiplication
vertical bar (|), unary is reverse, binary is mod?
with colon (:) one can force the use of the unary mode, e.g.
exclamation mark (!) applied to an integer produces the natural numbers from 0 to that integer minus one:
percent sign (%) is division