[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Standard libraries (was Re: Virgin tables)
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 30 Dec 2010 20:38:50 +0200
On Thu, Dec 30, 2010 at 8:13 PM, Mark Hamburg <mark@grubmah.com> wrote:
> Having pushed for standard libraries, I do think that they should hold to a few principles:
Both of these principles are good starting places. Naturally we've
been here before [1]. That thread was entertaining, because we could
not agree on what a standard map() function would look like, other
than the obvious point that it should take some sequence and create
another sequence by applying a function. 'sequence' is not a Lua term,
so we had various options - work on tables, work on iterators, etc.
I know the standard library itch, since scratching it produced
Penlight, which honestly is too eccentric to be a 'standard' library -
it is a collection of my favourite idioms. But the motivation was to
make it easy to do easy things, and wrap up any magical bits so that
users of the libraries did not have to use magic for ordinary purposes
[2]
steve d.
[1] http://lua-users.org/lists/lua-l/2009-12/msg00644.html
[2] in the fantasy literature around magic, this is a common theme;
that magic should be used sparingly, if at all. Le Guin speaks of not
upsetting the balance, and Pratchett claims that actual cost of magic
is always more than you're prepared to spend. In software terms, use
of magic adds to 'technical debt'. Harry Potter would make a poor
software engineer, using magic to fix his glasses!