Trivial (but not bikeshed please) question of style…
via Digitalmars-d
digitalmars-d at puremagic.com
Tue Oct 28 11:49:55 PDT 2014
On Tuesday, 28 October 2014 at 17:57:26 UTC, Russel Winder via
Digitalmars-d wrote:
> Python's take on this works quite well:
>
> x.sort()
>
> is a mutating sort delivering nothing, whilst:
>
> sorted(x)
Yes, I also find the grammatical distinction interesting. One
possible mapping:
- imperative for mutation: do "sort" !
- adjectives for value semantics: it returns a "sorted" version.
- present participle for generators: it adds "sorting" property
to input.
More information about the Digitalmars-d
mailing list