Skip to content

Instantly share code, notes, and snippets.

@ivar
Created April 18, 2015 18:01
Show Gist options
  • Save ivar/4c4f767cf2f6279cf404 to your computer and use it in GitHub Desktop.
Save ivar/4c4f767cf2f6279cf404 to your computer and use it in GitHub Desktop.
(defn greeting
([] (greeting "World"))
([msg] (str "Hello, " msg exclamation ))
([msg1, msg2](str msg1 ", " msg2 exclamation ))
)
(greeting "Good morning" "Clojure")
;; For testing
(assert (= "Hello, World!" (greeting)))
(assert (= "Hello, Clojure!" (greeting "Clojure")))
(assert (= "Good morning, Clojure!" (greeting "Good morning" "Clojure")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment