lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Henning Diedrich <hd2010@eonblast.com> writes:

> On 4/11/11 12:47 PM, steve donovan wrote: 
>
>> In particular, chaining functions with this kind of side-effect is
>> always a recipe for potential disaster.
>>
>> l2 = l1:sort():map(string.upper)
>>
>> Quick question: has l1 been modified?
>>
>> You have to be awake with this apparently simple expression if the
>> methods have mixed semantics, e.g if sort() modifies its object
>> in-place and map returns a new list.  (Naturally, I have been guilty
>> of this sin before.)
>
> I heard in some other quarters it's called schönfinkeln and is all the
> hype.
>
> Seriously, this is not a sin to everyone.

Nothing is a sin to everyone, and yet nobody wants to live in a world
where nothing is a sin to anyone.

-- 
David Kastrup