Iterable

An Iterable object is one that can generate an Iterator.

if some_object implements Iterable do
  for each value in some_object do
    print value

Some of Sparkle's classes implement Iterable, including:

A for each loop internally calls the iterator getter to get an Iterator object on which it will continuously call has_next and next to generate values for itself.

Required Fields

A getter that returns a newly created Iterator.

print "hello world"