Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

Idiom # 319: Generator function

See programming-idioms.org:

Fuzion has no support for generator functions. A somewhat similar thing to generators can be achieved by defining an effect. In the example below we define effect g. Feature call contains the implementation of the generator function. The call to replace is necessary to replace to currently installed instance of the effect. When the effect is installed (instate_self), it can be called via g.env.call.

Code

Runnable Example

last changed: 2024-10-17