[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Microlight (was Re: paving cowpaths with libraries)
- From: Ross Bencina <rossb-lists@...>
- Date: Mon, 20 Feb 2012 22:16:39 +1100
On 20/02/2012 5:30 AM, Dirk Laurie wrote:
The List metatable would contain the standard table library and some ml
functions, plus 'sorted' (so that L:sorted() not only sorts L, but also
Playing the naming game:
Qt has this convention where verbs like sort() are mutators that act on
the instance (ie the name means "_sort_ myself", adjectives like
sorted() return a sorted *copy* of the collection (ie the name means
"return a _sorted_ version of self" it's an adjective). Other examples:
I like this convention, just just because I'm a heavy Qt user, but
because it makes sense.
I would find it kind of weird if sorted() just returned a copy of self,
if that's the desire, I'd say it's better to have sort() return itself.
sorted() should make a sorted copy.
Just my two cents.. take or leave,