Examples

You are viewing an old version of this entry, click here to see latest version.

The Iterable Typedef is really powerful, it also enables you to iterate a Class:

class MyClass {
    public static var names = ["ted", "fred", "tim"];
    public static function iterator () : Iterator<String> 
    {
        return names.iterator();
    }
}

class Test {
    public static function main ()
    {
        for (i in MyClass)
            trace(i); // ted, fred, tim
    }
}
version #8032, modified 2010-02-05 13:51:44 by hhoelzer
0 comment