Why is array.reverse a property and not a method?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jul 12 12:42:49 PDT 2010


On 07/12/2010 02:28 PM, bearophile wrote:
> Andrei Alexandrescu:
>>> sort is all but deprecated, since std.algorithm.sort exists.
>>>
>>> reverse could even more easily be implemented as a library
>>> function than sort, it should be removed as well.
>>
>> http://www.digitalmars.com/d/2.0/phobos/std_algorithm.html#reverse
>
> D site can enjoy a page that lists the deprecated D2 features (and
> maybe for each of them lists what to use instead of it), so current
> D2 programmers can avoid what will be removed.

Good point.

I'd to do some more renaming around Phobos and figure out an approach to 
deprecating names that aren't longer used.

I'm thinking:

std.conv -> std.conversion

Rationale: it's a seldom typed name so shortening it is just odd

std.stdio -> std.io

Rationale: stuttering sucks.

put(R, E) -> putNext(R, E)

Rationale: conveys the notion that there is progress in the output.

BidirectionalRange -> DoublyEndedRange

Rationale: bidirectional suggests something that can move *in* either 
direction, whereas in fact the range can be shortened from either end.

Would this be an improvement?


Andrei


More information about the Digitalmars-d mailing list