Last active
August 29, 2015 14:22
-
-
Save pbalduino/f4594e02932380e94fa0 to your computer and use it in GitHub Desktop.
-> e ->>
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 minha-funcao [a b] | |
(println "a =" a "- b=" b)) | |
(-> "valor" | |
(minha-funcao "outro")) | |
; a = valor - b= outro | |
(->> "valor" | |
(minha-funcao "outro")) | |
; a = outro - b= valor | |
;; quando você usa funções com apenas um argumento, tanto faz um quanto o outro, | |
;; e também tanto faz usar parênteses ou não | |
(defn apenas-um [x] | |
(str "x = " x) | |
x) | |
(-> "valor" | |
apenas-um) | |
; x = valor | |
(-> "valor" | |
(apenas-um)) | |
; x = valor | |
(->> "valor" | |
apenas-um) | |
; x = valor | |
(->> "valor" | |
(apenas-um)) | |
; x = valor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment