Replies: 1 comment 8 replies
-
@lilactown Looks good to me, but I propose we write |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Proposal
Potential alternatives:
defn*
,defn ^:generator
Rationale
Generators are a fundamental construct in JS that enables novel evaluation semantics. Fundamentally they are lazy, stateful state machines written with a single keyword
yield
. The following use cases use generators as a building blockLazyIterable
in this project)core.async
to JSConsiderations
Building lazy iterables
In Clojure, there is
lazy-seq
for building custom lazy sequences. We could provide a simple alternative: alazy
function that accepts a generator functionsAsync generators
Whatever syntax we pick should interop with async functions.
Beta Was this translation helpful? Give feedback.
All reactions