Advent of Code 2020 in Common Lisp
I'm using the Advent of Code 2020 to exercise my Common Lisp muscles.
Learnings
Common Lisp is an enormous language with a rich library ecosystem. It's easy to get stuck in the same old corner of the language you are familiar with. What I love about the Advent of Code event is the opportunity to see how other hackers tackle the same small problems. Here are some of my personal learnings from 2020.
labels
is likeflet
but allows for recursion- Check that a value is within a range thusly:
(<= min value max)
- You can map any sequences, for example
(map 'string #'fn "ssdfs")
cl-ppcre:register-groups-bind
simplifies text extractionparseq
can be an even nicer text parsing toolalexandria:xor
is Common Lisp's missing xormetabang-bind
can simplify code that requires multiple different kinds of bindingsalexandria:map-combinations
and related functions are nice
Anthony Green green@moxielogic.com