3 ms·
The Clojure code isn't particularly well written, and given the apparent goal here using a regex is hugely overkill. Despite being inelegant, enumerating all th
by tensor 15y ago
The Clojure code isn't particularly well written, and given the apparent goal here using a regex is hugely overkill. Despite being inelegant, enumerating all the valid keycodes to a set is the most appropriate answer.
Clojure provides a constant time dispatch function called case that is perfect for this.