lua-users home
lua-l archive

Re: ipairs in Lua 5.3.0-alpha

[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.

AltStyle によって変換されたページ (->オリジナル) /