Re:Swift Standard Library: Generators, Sequences and Collect...
by tlrobinson on Tuesday December 30, 2014 @02:15PM
(#8816143)
"So a generator is simply something that can give you the next element of some sequence of elements."
Is this a common usage of the word "generator"?
At least in JavaScript and Python you'd call that an "iterator", and a "generator" is a special type of function that acts as an iterator, using the "yield" keyword.
Is this a common usage of the word "generator"?
At least in JavaScript and Python you'd call that an "iterator", and a "generator" is a special type of function that acts as an iterator, using the "yield" keyword.