Created
May 8, 2011 21:11
-
-
Save ekoontz/961694 to your computer and use it in GitHub Desktop.
clojure mapcat howto
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
user=> (defn cool-kids [x] (if (= x 'kurt) (list x) nil)) | |
#'user/cool-kids | |
user=> (cool-kids 'kurt) | |
(kurt) | |
user=> (cool-kids 'bob) | |
nil | |
user=> (map #'cool-kids '(kurt bob tony)) | |
((kurt) nil nil) | |
user=> (mapcat #'cool-kids '(kurt bob tony)) | |
(kurt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment