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

Jonathan M Davis jmdavisprog at gmail.com
Mon Jul 12 15:58:51 PDT 2010


On Monday, July 12, 2010 12:42:49 Andrei Alexandrescu wrote:
> 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

Speaking of deprecated (or intended to be deprecated) features, is using 
opCall() with structs on the list? I recall that scope as storage class is being 
deprecated, but did opCall() get put on that pile as well? Or is it supposed to 
stay?

It's definitely hard to keep track of what exactly is supposed to be sticking 
around and what's getting the axe.

- Jonathan M Davis


More information about the Digitalmars-d mailing list