Re: Stride in foreach ranges

2013-08-30 Thread Paul Jurczak
On Friday, 30 August 2013 at 14:18:22 UTC, Dicebot wrote: On Friday, 30 August 2013 at 06:31:39 UTC, Paul Jurczak wrote: BTW, DMD produces faster code when for loop is used instead, with GDC it makes no difference. This pretty much shows that there is nothing wrong in language with current io

Re: Stride in foreach ranges

2013-08-30 Thread Paul Jurczak
On Friday, 30 August 2013 at 17:19:11 UTC, Paul Jurczak wrote: On Friday, 30 August 2013 at 14:11:06 UTC, Namespace wrote: [..] Can you prove this on DPaste? It's there at: http://dpaste.dzfl.pl/2cf504db I'm not sure what are the compiler switches on DPaste and I don't see an option to cha

Re: Stride in foreach ranges

2013-08-30 Thread Paul Jurczak
On Friday, 30 August 2013 at 14:11:06 UTC, Namespace wrote: On Friday, 30 August 2013 at 06:31:39 UTC, Paul Jurczak wrote: Is there a better way to express a range with stride than this: foreach (i; iota(0, N, 2)) Maybe something similar to F# syntax: foreach (i; 0..2..N) I found this thread

Re: Stride in foreach ranges

2013-08-30 Thread Dicebot
On Friday, 30 August 2013 at 06:31:39 UTC, Paul Jurczak wrote: BTW, DMD produces faster code when for loop is used instead, with GDC it makes no difference. This pretty much shows that there is nothing wrong in language with current iota approach and it is simply problem of bad dmd code gener

Re: Stride in foreach ranges

2013-08-30 Thread Namespace
On Friday, 30 August 2013 at 06:31:39 UTC, Paul Jurczak wrote: Is there a better way to express a range with stride than this: foreach (i; iota(0, N, 2)) Maybe something similar to F# syntax: foreach (i; 0..2..N) I found this thread suggesting syntax improvement http://forum.dlang.org/thread

Stride in foreach ranges

2013-08-29 Thread Paul Jurczak
Is there a better way to express a range with stride than this: foreach (i; iota(0, N, 2)) Maybe something similar to F# syntax: foreach (i; 0..2..N) I found this thread suggesting syntax improvement http://forum.dlang.org/thread/bug-411...@http.d.puremagic.com/issues/ but I don't think it p