@ cd714ebecbf3d298a78692baf2a78725293b3ff2 | history
; golden.gov.lisp: one program that uses every part of the encoding, so a
; change to any byte the compiler writes shows up as a diff of golden.gov.
; This note is long on purpose: past 200 characters it no longer fits one
; RFC 5280 explicitText, and has to be split across several user notices,
; then joined back in order when the file is decoded.
(define square (lambda (n) (* n n))) ; a builtin, a symbol, a lambda
(square 12) ;=> 144
; Every literal kind: integers, floats, strings with escapes and code
; points outside ASCII, booleans and the empty list.
'(-42 0 3.25 -0.5 1.0e10 "tab\there" "\u{1F3DB} capitol" "" T F ()) ;=> (-42 0 3.25 -0.5 10000000000.0 "tab\there" "🏛 capitol" "" T F ())
; A dotted pair, and a dot followed by a list, which reads as a longer list.
'(a . b) ;=> (a . b)
'(a . (b c)) ;=> (a b c)
; (square (+ 1 2)) appears twice at the same depth, so it is one shared node.
(+ (square (+ 1 2))
(- (square (+ 1 2)) 1)) ;=> 17
(if (< 1 2) "yes" "no") ;=> "yes"
(car (cdr '(1 2 3))) ;=> 2
(strcat "GOVERN" "MENT") ;=> "GOVERNMENT"