lua-users home
lua-l archive

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


On Mon, Dec 6, 2010 at 5:02 PM, Javier Guerra Giraldez
<javier@guerrag.com> wrote:
> in my book, a function that (within reason) normalizes its input is
> more robust than one that fails.

Except for that nil case!

> of course, consistently failing is immensely more robust than
> producing undesirable output on questionable input.

Imagine you have generated 1MB of XML - now look for the nil token.

> a mapconcat() function would be nice,  but that seems a good
> candidate for a user library,

In Penlight, List.join() works like that, but that module is trying to
slavishly reproduce the same results as Python...

Of course, it's easy to give out advice. I'm personally finding an
enhanced string.format to be useful since I have objects with
__tostring overriden.

steve d.