April 15, 2013
You could set the length to 0.

April 15, 2013
Not on associative arrays afaik.

On Monday, 15 April 2013 at 11:36:55 UTC, Tobias Pankrath wrote:
> You could set the length to 0.

April 15, 2013
On Sun, 14 Apr 2013 02:50:07 -0400, gedaiu <szabobogdan@yahoo.com> wrote:

> On Saturday, 13 April 2013 at 21:10:16 UTC, Nicolas Guillemot wrote:
>>> I think we should introduce a removeAll function for hashes. Either
>>> through Druntime or through a UFCS function that we could put in
>>> std.array or somewhere.
>>
>> How about .clear() for consistency with C++ containers?
>
> It looks nice... i am waiting for it :P

Might be confusing.  clear used to do what destroy does now and is still in TDPL.

-Steve
April 15, 2013
On Monday, 15 April 2013 at 11:36:55 UTC, Tobias Pankrath wrote:
> You could set the length to 0.

Before version 4.0 in C# a Clear extension-method just calls Collection.length = 0; Later this method was included to BCL.

In D length property for AA is readonly.

April 28, 2013
Am Mon, 15 Apr 2013 13:06:01 -0400
schrieb "Steven Schveighoffer" <schveiguy@yahoo.com>:

> On Sun, 14 Apr 2013 02:50:07 -0400, gedaiu <szabobogdan@yahoo.com> wrote:
> 
> > On Saturday, 13 April 2013 at 21:10:16 UTC, Nicolas Guillemot wrote:
> >>> I think we should introduce a removeAll function for hashes. Either through Druntime or through a UFCS function that we could put in std.array or somewhere.
> >>
> >> How about .clear() for consistency with C++ containers?
> >
> > It looks nice... i am waiting for it :P
> 
> Might be confusing.  clear used to do what destroy does now and is still in TDPL.
> 
> -Steve

Right, but the reason clear was renamed to destroy in the
first place was to remove this ambiguity. When I was new to D
I used clear() on AAs ignorant to the fact that it is not
meant to clear containers as in other languages.
Despite the issue with TDPL I'm looking forward to clear() as
a container method.

-- 
Marco

1 2
Next ›   Last »