Copying a snippet into HTML is where a documented language stops being the real one. Each block on the page is a program here with its recorded output beside it, and check.sh is what says the page is still true after a change.
15 lines
387 B
Plaintext
15 lines
387 B
Plaintext
(defenum Key
|
|
[space 32 escape 256 left 263 right 262])
|
|
|
|
(defn key-name [k Key] string
|
|
(cond
|
|
(= k :space) "space"
|
|
(= k :escape) "escape"
|
|
:else "an arrow"))
|
|
|
|
(defn main []
|
|
;; :space resolves against the parameter's enum at compile time.
|
|
;; A typo is an error here, not a wrong number later.
|
|
(print-line (key-name :space))
|
|
(print-line (key-name :left)))
|