www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Filter out consecutive elements based on comparison between adiacent

reply Langer <Langer gmail.org> writes:
Hi all,

Ditto... something like:

filter!((a,b) => a.foo != b.foo)

Thank you!
Jan 31
next sibling parent Alex <sascha.orlov gmail.com> writes:
On Thursday, 31 January 2019 at 13:18:39 UTC, Langer wrote:
 Hi all,

 Ditto... something like:

 filter!((a,b) => a.foo != b.foo)

 Thank you!
I would say: ´´´ arr.group.map!(el => el[0]) ´´´
Jan 31
prev sibling parent reply Alex <sascha.orlov gmail.com> writes:
On Thursday, 31 January 2019 at 13:18:39 UTC, Langer wrote:
 Hi all,

 Ditto... something like:

 filter!((a,b) => a.foo != b.foo)

 Thank you!
but... why not ´´´ arr.uniq ´´´
Jan 31
parent Langer <Langer gmail.org> writes:
On Thursday, 31 January 2019 at 13:25:21 UTC, Alex wrote:
 On Thursday, 31 January 2019 at 13:18:39 UTC, Langer wrote:
 Hi all,

 Ditto... something like:

 filter!((a,b) => a.foo != b.foo)

 Thank you!
but... why not ´´´ arr.uniq ´´´
thank you, uniq is perfect.
Jan 31