lua-users home
lua-l archive

Re: table library API change proposal

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


> The current table library isn't convenient to manage FIFOs
> efficiently. Given a table containing some elements,
Take a look at:
 http://www.lua.org/pil/11.4.html
Pretty efficient FIFO, isn't it?
Its a matter of taste of going with Robertos "no problem in 200 years"
pragmatism, or if you want to add a modulo wrap around to run forever.
Additionally as matter of impression, one can shoot down any idea by
referencing another programming language, cause we want to be differen
:-)
So there i shoot: Javascripts splice,
http://www.w3schools.com/jsref/jsref_splice.asp
I like it, simple and powerfull, optional remove and optinal append
and insert all in one convenient call. I'd only argue to remove the
return value for performance.
Kind regards ;-)

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