lua-users home
lua-l archive

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


2014-08-18 21:23 GMT+02:00 Jan Behrens <jbe-lua-l@public-software-group.org>:
>
> My main proposal is to allow ipairs to be used as a general
> interface for (ordinal) iteration.
> ...
> If ipairs(...) accepted a function or an iterator triplet (which it
> currently doesn't do in Lua 5.3-alpha), then ...

Aha! Finally you have put it in a way that penetrates my thick
and lazy skull.

Well, your proposal is one for which PUC approval is not needed,
since a simple `ipairs=require"supercool_ipairs"` with an appropriate
supercool_ipairs.lua in the module path will do it. (In fact, a similar
comment applies to anything in the standard libraries.)

Will I use it? It depends. If PUC continues with its intention of
(a) removing __ipairs (b) making ipairs essentially equivalent to an
iteration that can easily be coded in just the language, I might.
In any case, I could still say `jpairs=require"supercool_ipairs"`

Either way, if you make your extension available as a rock, the
decision to use it will be easier to make.