lua-users home
lua-l archive

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


On 4/11/11 12:47 PM, steve donovan wrote:
On Mon, Apr 11, 2011 at 12:17 PM, David Kastrup <dak@gnu.org> wrote:
Intelligence needs restraint, or its potential is locked away behind the
event horizon of incomprehensibility.
Amen!

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.)

steve d.
I heard in some other quarters it's called schönfinkeln and is all the hype.

Seriously, this is not a sin to everyone.

Henning