From 4355420994a98ff0f29bb9b60c24565b57526dde Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 3 Jan 2021 16:19:23 -0600 Subject: [PATCH] Remove function `eachy`. Instead use `each`. --- examples/iterate-fiber.janet | 9 --------- src/boot/boot.janet | 8 +------- 2 files changed, 1 insertion(+), 16 deletions(-) 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.