klyn.collections.Generator.close
method
public abstract close() as Void
Description

Terminates iteration and executes active resource/finally cleanups once. Closing an unstarted generator does not execute its body. Repeated closes have no effect. Cleanup exceptions propagate to the caller.

Throws
  • IllegalStateException if this generator is already executing.
Example

try values = range(10): print(values.next())