On Tue, 2014-10-28 at 13:44 -0400, Steven Schveighoffer via
Digitalmars-d wrote:
[…]
> If you are saying we should expect sort(arr) to return a *copy* of the 
> array that is sorted, I don't think that's a fair assessment of D user 
> expectations. D is not a functional language. Even D pure function can 
> mutate data.

Python's take on this works quite well:

        x.sort()

is a mutating sort delivering nothing, whilst:

        sorted(x)

created a new sorted item based on the data of x. In both case you can
give optional arguments to specify the sort key on the data in the
container and the direction of the sort.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to