Earlier quoted context omitted.
This is the function that confused the person you respond to, ported to Python: def color(word, letter, idx): if word[idx] == letter: return GREEN elif letter in word: return YELLOW else: return GREY I know which one I'd prefer to grok at 2AM with alerts going off.
Honestly both read about the same to me, and I'm largely unfamiliar with Clojure. The main difference appears to be the 3 `str` callouts, which appear extraneous as the following version works just the same: (defn color [word letter idx] (cond (= (nth word idx) letter) :green (str/includes? word letter) :yellow :else :gray)) Interesting that even with the `str` callouts removed, the function still appears to work on…
Or possibly the code even uses non-symbols for some of the arguments. Suppose that letter is sometimes the integer 1.