Had another 48hr game jam this weekend...

Manu turkeyman at gmail.com
Sun Sep 1 07:44:31 PDT 2013


On 1 September 2013 22:01, Dmitry Olshansky <dmitry.olsh at gmail.com> wrote:

> 01-Sep-2013 06:57, Andrej Mitrovic пишет:
>
>> On 9/1/13, Manu <turkeyman at gmail.com> wrote:
>> auto idx = array.countUntil(item);
>> if (idx != -1)
>>      array = array.remove(idx);
>>
>
> We just need better documentation/examples..
> E.g. this works fine:
>
>     int[] arr = [1, 2, 3, 1, 4 ];
>     arr = remove!(x => x == 1)(arr);
>     assert(arr == [2, 3, 4]);
>
> And one can even ask it to do unstable removal which is faster.


I'd agree that's fairly acceptable. It's just not obvious/intuitive.
My bad, I should be more familiar with phobos than I am...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130902/2d61594d/attachment.html>


More information about the Digitalmars-d mailing list