diff --git a/examples/iterate-fiber.janet b/examples/iterate-fiber.janet index 4547c299..9d6a49cf 100644 --- a/examples/iterate-fiber.janet +++ b/examples/iterate-fiber.janet @@ -7,15 +7,6 @@ (print "simple yielding") (each item f (print "got: " item ", now " (fiber/status f))) -(def f - (coro - (for i 0 10 - (yield (string "yield " i)) - (ev/sleep 0)))) - -(print "old style fiber iteration") -(eachy item f (print "got: " item ", now " (fiber/status f))) - (def f (coro (for i 0 10 diff --git a/src/boot/boot.janet b/src/boot/boot.janet index 58281d39..08866ff8 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -514,12 +514,6 @@ [x ds & body] (each-template x ds :pairs body)) -(defmacro eachy - `Resume a fiber in a loop until it has errored or died. Evaluate the body - of the loop with binding set to the yielded value.` - [x fiber & body] - (loop-fiber-template x fiber body)) - (defmacro repeat "Evaluate body n times. If n is negative, body will be evaluated 0 times. Evaluates to nil." [n & body] @@ -568,7 +562,7 @@ * :pairs -- iterate over the key-value pairs as tuples in a data structure. - * :in -- iterate over the values in a data structure. + * :in -- iterate over the values in a data structure or fiber. * :generate -- iterate over values yielded from a fiber. Can be paired with the generator function for the producer/consumer pattern.