alexschneider / teascript

5 stars 2 forks source link

Generating Code with for Loops #88

Open juansc opened 9 years ago

juansc commented 9 years ago

let's say we have the following code:

for x in a
    ...code...
end

This should become the following code in JavaScript

for( x = a.next(); x != EOI; x = a.next()){
    ...code...
}

Note that the iterable should have a next method and some kind of way to return an EOI (end of iterable) so that writing the javascript is easy.