lua-users home
lua-l archive

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


On Sat, Apr 28, 2012 at 7:07 AM, David Manura <dm.lua@math2.org> wrote:
> (1) The names ml.extend, ml.inject, and ml.delete relate only loosely
> to purpose.

The word 'extend' comes from Python usage (add things to this list)
and the dict-equivalent used to be ml.update, but somehow I got
persuaded to use ml.import. (Both names make sense, in context, and
here an alias will do fine.)

>  I don't get the sense from the names that "delete" (as in
> ml.delete) and "remove" (as in table.remove) are very similar

'inject' (also in my humble opinion) is poorly named. I think we
called the equivalent 'insertvalues' in Penlight, and something like
that would do better (like 'insertrange', 'removerange', etc)

> (2) Assuming tstring is for debugging not serialization, we probably
> want to escape unreadable chars.

An interesting question I've been discussing with Vadim; tstring
should be as correct as possible, as long as it remains a simple
robust debugging/light serialization tool.  I'm not entirely a fan of
'big serialization', from years of maintaining MFC applications which
were crippled by their data format mirroring the internal
implementation, hence breaking encapsulation and generally making
upgrading a bitch.  (I think Alexander has a more industrial table
serializer available)

That being said, unprintable chars should be escaped, perhaps in
'stupid' mode (which is another misnomer)

> (3) I see some functions in microlight of common utility
> (escape/expand/readfile/exists/tstring/indexof/range/invert/collect/...and
> probably class).  Others I'm not so sure about.

There will always be a few such odd children in any big family.  Part
of it comes from my fluctuating enthusiasm for functional forms like
map, filter, compose and bind.

> like memoize, findbin [5], trim [8], and writefile [3] or could be
> more complete

There was a request for trim, and personally I've missed writefile;
memoize was part of Jay's original proposal and it should go in.

I'm becoming aware of trying to keep some backward compatibility,
since there are apparently a few people who are already using it. But
(always) there's the story of Stu Feldman, who invented make and made
it require tabs; by the time he realized this mistake, he already had
a few dozen users.

steve d.