Created
September 12, 2018 19:24
-
-
Save simongray/6fd9717026b644db7030b2986ddbf5a5 to your computer and use it in GitHub Desktop.
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 enumerated | |
[xs] | |
(apply str (concat (interleave (drop-last 2 xs) (repeat ", ")) | |
(interpose " og " (take-last 2 xs))))) | |
(do | |
(println (enumerated ["a"])) | |
(println (enumerated ["a" "b"])) | |
(println (enumerated ["a" "b" "c"])) | |
(println (enumerated ["a" "b" "c" "d"]))) |
Author
simongray
commented
Sep 12, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment