Thread overview |
---|
January 31, 2019 Filter out consecutive elements based on comparison between adiacent two | ||||
---|---|---|---|---|
| ||||
Hi all, Ditto... something like: filter!((a,b) => a.foo != b.foo) Thank you! |
January 31, 2019 Re: Filter out consecutive elements based on comparison between adiacent two | ||||
---|---|---|---|---|
| ||||
Posted in reply to Langer | 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])
´´´
|
January 31, 2019 Re: Filter out consecutive elements based on comparison between adiacent two | ||||
---|---|---|---|---|
| ||||
Posted in reply to Langer | 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
´´´
|
January 31, 2019 Re: Filter out consecutive elements based on comparison between adiacent two | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alex | 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.
|
Copyright © 1999-2021 by the D Language Foundation