Closed darkleaf closed 4 years ago
(ns example (:require [cloroutine.core :refer [cr]])) (defn example [] (cr {} (let [initial 0] (loop [i initial] (prn initial) (let [i (inc initial)] (if (< initial 10) (recur i) i)))))) (let [coroutine (example)] (coroutine))
stdout:
0 1 2 3 4 5 6 7 8 9 10
A value of initial binding is changing unexpectable. Without cr this code should continuously print 0.
initial
cr
0
Fixed in version 9.
Thanks!
stdout:
A value of
initial
binding is changing unexpectable. Withoutcr
this code should continuously print0
.