Re:Effective Scala
by TylerE on Thursday September 05, 2013 @11:27AM
(#6334744)
I don't suppose I could talk you into re-writing it into idiomatic clojure? Since someone else already rewrote it in idiomatic scala.
[ Parent
| on HN ]
Re:Effective Scala
by brandonbloom on Thursday September 05, 2013 @11:58AM
(#6334930)
Just guessing from context, but probably something like this:
(defn completion-items [items options]
(->> (for [[item v] items]
(when-let [nonterminal (expected-symbol item options)]
(when-let [next-value (gen-next-value v options)]
[(update-in item [:dot] inc) next-value])))
(remove nil?)
(into {})))