very much a clojure beginner and would love to know how idiomatic this is
(defn lazy-get
[f x]
(if-let [result (f x)]
(cons result
(if-let [x' (result :next)]
(lazy-seq (lazy-get f x'))
nil))))
@screamish looks reasonable to me. I didn't know you could use a quote in that context (`x'`). I think usually I would use x*
. But I see no glaring issues.
Assuming it works ;) I'm not able to test it out at the moment.
cheers