Re: .byKeyValue should probably return a Tuple

2017-02-17 Thread H. S. Teoh via Digitalmars-d
On Thu, Feb 16, 2017 at 08:43:57AM +, Seb via Digitalmars-d wrote: > On Thursday, 16 February 2017 at 05:20:32 UTC, H. S. Teoh wrote: > > On Thu, Feb 16, 2017 at 05:02:41AM +, Yuxuan Shui via Digitalmars-d > > wrote: > > > On Wednesday, 15 February 2017 at 22:02:01 UTC, Seb wrote: [...] >

Re: .byKeyValue should probably return a Tuple

2017-02-16 Thread Seb via Digitalmars-d
On Thursday, 16 February 2017 at 05:20:32 UTC, H. S. Teoh wrote: On Thu, Feb 16, 2017 at 05:02:41AM +, Yuxuan Shui via Digitalmars-d wrote: On Wednesday, 15 February 2017 at 22:02:01 UTC, Seb wrote: > On Wednesday, 15 February 2017 at 21:54:20 UTC, Yuxuan Shui > wrote: > > [...] > >

Re: .byKeyValue should probably return a Tuple

2017-02-15 Thread H. S. Teoh via Digitalmars-d
On Thu, Feb 16, 2017 at 05:02:41AM +, Yuxuan Shui via Digitalmars-d wrote: > On Wednesday, 15 February 2017 at 22:02:01 UTC, Seb wrote: > > On Wednesday, 15 February 2017 at 21:54:20 UTC, Yuxuan Shui wrote: > > > for(k, v; aa) { ... } is better than: > > > > > > for(o; aa) { > > > auto k

Re: .byKeyValue should probably return a Tuple

2017-02-15 Thread Yuxuan Shui via Digitalmars-d
On Wednesday, 15 February 2017 at 22:02:01 UTC, Seb wrote: On Wednesday, 15 February 2017 at 21:54:20 UTC, Yuxuan Shui wrote: for(k, v; aa) { ... } is better than: for(o; aa) { auto k = o.key, v = o.value; ... } right? Are there any reason why .byKeyValue doesn't return a Tuple?

Re: .byKeyValue should probably return a Tuple

2017-02-15 Thread Seb via Digitalmars-d
On Wednesday, 15 February 2017 at 21:54:20 UTC, Yuxuan Shui wrote: for(k, v; aa) { ... } is better than: for(o; aa) { auto k = o.key, v = o.value; ... } right? Are there any reason why .byKeyValue doesn't return a Tuple? There's byPair (http://dlang.org/phobos/std_array.html#byPair)