()is a shorter way of writing
- To concatenate two strings,
(format()"~a~a"a b)is shorter than
(concatenate'string a b).
forcan be replaced with
as, saving a byte.
- Large numbers can be compacted by writing them in base 36 with the prefix
- Tips for golfing in Lisp
- The Common Lisp Hyper-Spec has a useful alphabetical list of functions.
- The Implementation Notes for GNU CLISP have information specific to the version of Lisp used on code.golf.
quote as a variable
Sometimes, it is helpful to use
quote as a variable, since
'foo is short for
(quote foo). To use
quote in an expression, use dotted pair notation.
; Example: (dotimes(i 10)(format t"~d ~a~%"i"potato")) ; this (dotimes'10(format t"~d ~a~%".'"potato")) ; is equivalent to this