On 28/01/2014, at 10:43 PM, john skaller wrote: > How's about dis:
CRAP. But sometimes crap grows nice 'shrooms .. for var i in 0 <= .. < 10 do // excludes 10 for var i in 0 <= .. <= 10 do // includes 10 for var i in 10 >= .. > 0 do // includes 10, excludes 0, downwards so ".." just means " i and i " .. for var i in 10 >= i and i > 0 do ... and one is tempted by for 10 >= var i > 0 do ... ... only problem is I don't think this will parse since "10" could be an expression and it might be: for j >= i > 0 do which might be confused with a loop like for j in ... noting that "in" is actually binary operator as well ... perhaps for (min < i <= max) do ... would disambiguate. Hmm .. no .. the first form is much better for var i in 0 <= .. < 10 | odd | fun (x:int)=> x.double == sqr (sqrt x.double) do which says all the odd integers between 0 and 10 (exclusive) which are also squares. So a generator followed by filters .. getting warmer .. -- john skaller skal...@users.sourceforge.net http://felix-lang.org ------------------------------------------------------------------------------ WatchGuard Dimension instantly turns raw network data into actionable security intelligence. It gives you real-time visual feedback on key security issues and trends. Skip the complicated setup - simply import a virtual appliance and go from zero to informed in seconds. http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language