1 # Copyright (C) 2007-2009, Parrot Foundation.
6 An iterator is a type of PMC that helps with looping operations
7 involving arrays. The C<shift> and C<pop> operations on the iterator
8 return items from the array. The iterator itself provides a truth
9 value to determine if all elements in the array have been acted
10 upon. If the iterator is true, there are more items in the array to
13 This example also demonstrates a technique for easily creating an
14 array of strings, by creating a string literal and using the C<split>
20 .local pmc myarray, it
22 myarray = split " ", "foo bar baz boz"
26 unless it goto iter_end
40 # vim: expandtab shiftwidth=4 ft=pir: