I am newbie in Clojure. I have following Expressions:
(= (__ "Dave") "Hello, Dave!")
(= (__ "Jenn") "Hello, Jenn!")
(= (__ "Rhea") "Hello, Rhea!")
In place of __, in all 3 places must be inserted same expression so that the equality check in all 3 cases are true. At this point i have come up with str "Hello, ". As i understand this should produce "Hello, Dave" "Hello, Jenn" "Hello, Rhea" How do i put "!" mark at the and of each string? (I can only "write" expression in place of __)
Thank you
(= (format "Hello, %s!" "Dave") "Hello, Dave!"). but I don't know this is expected one.(= (str "Hello, " "Dave" "!") "Hello, Dave!")will work just fine as well :)(fn [name] (str "Hello, " name "!"))or similar ;) But I see that there is a perfectly good answer below now. Happy Clojuring!