Re: foreach(i,ref val; ndim_arr)??

2016-05-10 Thread 9il via Digitalmars-d-learn
On Tuesday, 10 May 2016 at 15:18:50 UTC, ZombineDev wrote: On Tuesday, 10 May 2016 at 10:21:30 UTC, ZombineDev wrote: (You can try it at: https://dpaste.dzfl.pl/c0327f067fca) import std.array : array; import std.experimental.ndslice : byElement, indexSlice, sliced; import std.range : iota,

Re: foreach(i,ref val; ndim_arr)??

2016-05-10 Thread 9il via Digitalmars-d-learn
On Monday, 9 May 2016 at 18:50:32 UTC, Jay Norwood wrote: I noticed some discussion of Cartesian indexes in Julia, where the index is a tuple, along with some discussion of optimizing the index created for cache efficiency. I could find foreach(ref val, m.byElement()), but didn't find an

Re: foreach(i,ref val; ndim_arr)??

2016-05-10 Thread ZombineDev via Digitalmars-d-learn
On Tuesday, 10 May 2016 at 10:21:30 UTC, ZombineDev wrote: On Monday, 9 May 2016 at 18:50:32 UTC, Jay Norwood wrote: I noticed some discussion of Cartesian indexes in Julia, where the index is a tuple, along with some discussion of optimizing the index created for cache efficiency. I could

Re: foreach(i,ref val; ndim_arr)??

2016-05-10 Thread ZombineDev via Digitalmars-d-learn
On Tuesday, 10 May 2016 at 13:52:27 UTC, ag0aep6g wrote: Am 10.05.2016 um 12:21 schrieb ZombineDev: auto indexed_range = lockstep( Tiny nitpick: lockstep doesn't return a range. It uses opApply to support foreach. Yes I know and I chose it in purpose, because it allows ref access to

Re: foreach(i,ref val; ndim_arr)??

2016-05-10 Thread ag0aep6g via Digitalmars-d-learn
Am 10.05.2016 um 12:21 schrieb ZombineDev: auto indexed_range = lockstep( Tiny nitpick: lockstep doesn't return a range. It uses opApply to support foreach.

Re: foreach(i,ref val; ndim_arr)??

2016-05-10 Thread ZombineDev via Digitalmars-d-learn
On Monday, 9 May 2016 at 18:50:32 UTC, Jay Norwood wrote: I noticed some discussion of Cartesian indexes in Julia, where the index is a tuple, along with some discussion of optimizing the index created for cache efficiency. I could find foreach(ref val, m.byElement()), but didn't find an

foreach(i,ref val; ndim_arr)??

2016-05-09 Thread Jay Norwood via Digitalmars-d-learn
I noticed some discussion of Cartesian indexes in Julia, where the index is a tuple, along with some discussion of optimizing the index created for cache efficiency. I could find foreach(ref val, m.byElement()), but didn't find an example that returned a tuple index. Is that supported?