I put a lot of painful work into making the looping constructs correct. But I failed!
The problem is non-trivial. The code for a loop like: for var i in 0uz upto s.len - 1uz do is generated by the parser without any type information. So the generated code has to work whether the type of the control variable is signed or not. We want to handle both 0 iterations and also the maximum number possible. Since loops are inclusive the above loop fails (rather, it's a finite but extremely long loop over all values) in the case the string "s" is zero length. Loops in C have the same problems, but they're much less reliable because "for" is so flexible. The idea for Felix was to be able to validate loops, possibly deconstruct some into parallel sections. To do that you need rigid semantics, i.e. it should be independent of a user defined increment and ending condition. So I have failed. I would like a better idea! Remember we seek a LOW LEVEL looping construct over a totally ordered domain (in fact, probably over integers). -- john skaller skal...@users.sourceforge.net http://felix-lang.org ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language