25
edits
Changes
→Iterators
Chapel implements iterators using a function-like syntax, although the semantic behaviour of an iterator differs from that of a function in some important ways. Unlike functions, instead of returning a value, Chapel iterators typically return a sequence of values. The '''yield''' statement, legal only within iterator bodies, returns a value and temporarily suspends the execution of the code within the iterator.
iterator fibonacci(n): integer {