4 ms·
You can easily create true one-at-a-time lazy-sequences. I've been working on my own implementation of miniKanren (from The Reasoned Schemer) in Clojure. It's b
by swannodette 16y ago
You can easily create true one-at-a-time lazy-sequences. I've been working on my own implementation of miniKanren (from The Reasoned Schemer) in Clojure. It's been quite challenging since the original implementation assumes the presence of TCO. Also one-at-time laziness is very much required here to enforce interleaving of streams results and to avoid divergence. I was happy to find I could get the same non-stack consuming behavior and that it turns out to perform better than miniKanren under Racket.
https://github.com/swannodette/logos/blob/master/src/logos/minikanren.clj#L226 https://github.com/swannodette/logos/blob/master/src/logos/m...