epoch-language icon indicating copy to clipboard operation
epoch-language copied to clipboard

foreach loops

Open GoogleCodeExporter opened this issue 10 years ago • 1 comments

Implement basic foreach() loops for iterating over a range or container. Should 
support the use of generators and numeric ranges, when available.


entrypoint :
{
    foreach(integer x in [100..2])
    {
        print(cast(string, x) ; " bottles of beer on the wall...")
    }

    print("Uh oh! Low on beer!")
}


Original issue reported on code.google.com by [email protected] on 15 Feb 2012 at 8:33

GoogleCodeExporter avatar Apr 21 '15 05:04 GoogleCodeExporter

hmmm.... personally i prefer just combining for and foreach into one generic 
"for"

entrypoint:
{
    for(var x in [1...100])
    {
        print(cast(string, x));
    }
}

Original comment by [email protected] on 15 Feb 2012 at 8:42

GoogleCodeExporter avatar Apr 21 '15 05:04 GoogleCodeExporter