Language idea: Generators (yield fn
, yield ret
, yield break
)
#26
Labels
area: language
Issues related to the design of the language.
state: approved
Enhancements and tasks that have been approved.
Milestone
The keyword is already reserved.
Something like:
yield fn
s may useyield ret
andyield break
; normalfn
s may not.yield fn
s must have at least oneyield ret
oryield break
expression.yield fn
s may not useraise
expressions, normalret
expressions, and error-propagating calls.yield fn
s do not have an implicit return value like normalfn
s.yield fn
is mutually exclusive withext fn
anderr fn
.yield fn
lambdas are supported.The transformation into a state machine will happen when the module is loaded by the runtime. If a
yield fn
passes semantic analysis, it must be transformable.This is tentatively approved for 2.0.
The text was updated successfully, but these errors were encountered: