var list:Vector<Cell> = generateList();
for (cell in list) {
}
int _g = (int)0;
Array< ::Dynamic > _g1 = generateList();
while (((_g < _g1->__Field(HX_CSTRING("length"), true)))) {
++(_g);
}
var list = generateList();
for (i in 0...list.length) {
}
Array< ::Dynamic > _g1 = generateList();
int _g2 = (int)0;
int _g = _g1->cellText->__Field(HX_CSTRING("length"),true);
while (((_g2 < _g))) {
int i = (_g2)++;
}
import haxe.io.*;
class Test {
static function main() {
for(i in new BetterIntIter(10, 20, 2))
trace(i);
}
}
class BetterIntIter {
var curr:Int;
var max:Int;
var jump:Int;
public inline function new(from:Int, to:Int, jump:Int = 1) {
this.curr = from;
this.max = to;
this.jump = jump;
}
public inline function hasNext():Bool
return curr < max;
public inline function next():Int
return curr += jump;
}
(function () { "use strict";
var Test = function() { }
Test.main = function() {
var _g_curr = 10, _g_max = 20, _g_jump = 2;
while(_g_curr < _g_max) {
var i = _g_curr += _g_jump;
console.log(i);
}
}
Test.main();
})();
+1 for coolness... I didn't know about this trick
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.