lua-users home
lua-l archive

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


* steve donovan:

> Another way of putting this: what are the functions you find yourself
> needing to rewrite for yourself?

To be honest, I've got a somewhat contrarian view on this topic.
Basically, I consider small utility functions irrelevant.  In my
experience, most programmers just don't use them.  And you can hardly
blame them if it's just one or two more lines of code to write the
thing using pairs()/ipairs() etc.

On the other hand, a collection of "almost built-in" types seems to
make sense to me.  These types ensure interoperability between
different packages (including thos written in C).  The list of useful
types I've identified so far is pretty short:

  - mutable byte arrays
  - arbitary-precision integers
  - I/O handles (multiple different kinds on some platforms)
  - UTF-16 strings (mainly for path names on Windows)
  - a NULL value for use in SQL and JSON, distinct from nil
  - perhaps decimal floating point numbers