How to Add A ByteArray Implementation to a class-Based Multimethod
I picked up this quick tip on #clojure the other day while fighting my way through importing Base64 data.
You, like me, may be tricked by the 'string' representation hanging around in the dispatch-value section of your defmethod declarations. The thing is that those are actually Java class references and thus you can put something like (class (byte-array 1)) in place of them to get the same effect.
Also, to properly type-hint your function to expect receiving a byte-array, use ^bytes (where is that documented?).
Special thanks go to gfredericks and brehaut.











