Enter an RPN expression. Values are pushed onto the stack; words take their
arguments from it. Type 'exit' to quit, 'clear' to empty the stack.
'ans' pushes again the result of the last input that left one
(3 4 + on one line, then ans -> 7).

Values:
  integer 3, float 3.14, scientific 1.23e-4, hex 0x1a, binary 0b1010,
  octal 0o123, complex 1+2j
  string:  "hello"   (shown on the stack as 'hello'; escapes \n \t \" \\ \xNN \uNNNN)
  list:    [1 2 3]   [1 2 3; 4 5 6]
  block:   {1 2 +}   (code, stored unevaluated; run it with eval)
           {1 2 +} collect -> [3]: run it on an empty stack, list what it left
  symbol:  :name     (a name as a value)
  array:   [1 2 3] array   (changes in place; shown like a list, in its own color)
  dict:    dict            (keys to values, changes in place; shown as {'a' 1}, empty as {:})
  literals: true false null

Names (three ways to write one):
  x      bare: a reference. A macro is expanded, a variable's value is
         pushed, a function or operator is run. Undefined: an error.
  :x     the name itself, as a value (a symbol)
  {x}    the name itself, as a code block
  Nothing looks ahead: a bare name is a reference even right before set,
  so the name a word binds is written :x (or {x}): 3 :x set, 1 5 :i {i} do.
  A string is never a name: "x" symbol turns text into a name.

Variables:
  3 :x set       3 :x =       42 :answer global

Conditionals:
  cond {true-branch} if
  cond {true-branch} {false-branch} ifelse
  {c1} {r1} {c2} {r2} 2 cond
  {try} {catch} iferror       {try} {handler} try  (handler gets {'kind' 'message' 'stack'})
                              (a caught error puts the stack back as it was)
  "MyError" "what went wrong" throw

Loops:
  1 10 :i {i echo} do         [1 2 3] :x {x echo} dolist
  {body} 3 times              {cond} {body} while
  {body} loop                 (repeat until break)

Functions:
  {a b} {a b +} :add defun    then: 3 4 add
  {a b} {b a} :swap2 defun    1 2 swap2 -> 2 1 (every value the body leaves)
  {a b} {a b +} lambda        an anonymous function value; call it with eval:
  {a} {a 2 *} lambda :f set   5 f eval

Macros:
  {args} {body} :name defmacro  the body runs at expansion time and returns code
  {2 *} {double} alias          names a code snippet
  gensym, macroexpand, concat-block, expand, sub, parse
  {1 2 +} code-text -> "{1 2 +}"   a block as text, not run; a b code= compares code; x code? tells a block

Output:
  3 echo       "x" printc (no line break)   [72 105 10] write-stdout-bytes
  3 echo-err   "x" printc-err               [72 105 10] write-stderr-bytes   (to standard error)

Arrays and dictionaries (words that change them end in !):
  a i at    v a i at!    v a append!    a pop!    n x array-of
  d k get   v d k put!   d k has?       d k del!  d keys  d values
  dup, set and function arguments share one array; a b same? tells whether two are the same one

Scripts:
  "lib.stk" include   run a file here, in this scope, every time
  "lib.stk" require   the same, once: requiring it again does nothing

Constants:
  pi  e  phi  tau  inf  nan
