class X
def main is shared
colors = ['red', 'green', 'blue']
for i, color in colors.numbered
print i, color
for i, color in colors.numbered
assert (i==0 and color=='red') _
or (i==1 and color=='green') _
or (i==2 and color=='blue')
See also: StandardLibraryExtensionMethods