mirror of
https://github.com/janet-lang/janet
synced 2024-11-24 09:17:17 +00:00
Remove function eachy
.
Instead use `each`.
This commit is contained in:
parent
c357af02c2
commit
4355420994
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user