Created
September 28, 2011 22:35
-
-
Save m0smith/1249439 to your computer and use it in GitHub Desktop.
Convert a number into a lazy sequence of digits as (digit-seq 1798) => (1 7 9 8)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn digit-seq | |
"Convert a number into a lazy sequence of digits as (digit-seq 1798) => (1 7 9 8)" | |
[num] (map #(- (int %) (int \0)) (str num))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment