Find file
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (11 sloc) 462 Bytes
; From
(def vowel? (set "aeiou"))
(defn pig-latin [word] ; defines a function
; word is expected to be a string
; which can be treated like a sequence of characters.
(let [first-letter (first word)] ; assigns a local binding
(if (vowel? first-letter)
(str word "ay") ; then part of if
(str (subs word 1) first-letter "ay")))) ; else part of if
(pig-latin "hello")
(pig-latin "vimclojure")