list of digits
Write a function that takes a number and returns a sequence of digits. Here's an example:
(digits 3452)
;=> [3 4 5 2]
For extra credit, let digit take another parameter, which is the base of the number in which to represent digits. The default will be 10, but it should work for any number >= 2.
(digits 3452 2) ;; 2 means binary
;=> [1 1 0 1 0 1 1 1 1 1 0 0]
Bonus points for clarity, interest, and efficiency.