Jump to content

Iterators: Difference between revisions

m
m (→‎{{header|Raku}}: Expand verbiage a bit, contrast explicit iterators with object slice notation)
Line 241:
 
=={{header|Raku}}==
Raku has iterators, but is rare for casual users to ever expilcityexplicitly use them. Operators and functions that are designed to work on Iterable objects generally have the iteration semantics built in; so don't need an iterator to be explicitly called. It is far, '''far''' more common to use object slices to do the task example operations.
 
Rakus iterators are one direction only (not reversible), since they are designed to be able to work with infinite streams. It is difficult to reverse a stream that has no end. If the object / collection is finite, it may be reversed, but that is a separate operation from iteration.
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.