I'm trying to implement pig latin using only what's in core in the
simplest way possible.
Does anyone see a simpler way?
I'm not happy with using three functions (some, set and str) to
determine if a letter is a vowel.

(defn pig-latin [word]
  (let [first-letter (first word)]
    (if (some (set "aeiou") (str first-letter))
      (str word "ay")
      (str (subs word 1) first-letter "ay"))))

(println (pig-latin "red")) -> "edray"
(println (pig-latin "orange")) -> "orangeay"

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to