Last active
July 4, 2017 12:00
-
-
Save pjullah/c5328d55bea3de5bf5d7867cf18fd725 to your computer and use it in GitHub Desktop.
Notes about Clojure
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
;; Lots of Clojure - http://matthiasnehlsen.com/ | |
; best explanation of apply vs map - http://stackoverflow.com/questions/2311528/clojure-apply-vs-map | |
(apply F [1 2 3 4 5]) | |
;translates to | |
(F 1 2 3 4 5) | |
(map F [1 2 3 4 5]) | |
;translates to | |
[(F 1) (F 2) (F 3) (F 4) (F 5)] | |
; show vars in current ns | |
(keys (ns-publics (ns-name *ns*))) | |
(defn vec-contains? | |
"Check if vector col contains value search" | |
[col search] | |
(some #(= search %) col)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment