lua-users home
lua-l archive

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




On 2018-05-29 04:15 PM, Dirk Laurie wrote:
What happened when it reached the end of the list?

What end of the list?


2018-05-29 21:06 GMT+02:00 Soni "They/Them" L. <fakedme@gmail.com>:

On 2018-05-29 03:58 PM, Dirk Laurie wrote:
2018-05-29 20:32 GMT+02:00 Russell Haley <russ.haley@gmail.com>:

On Tue, May 29, 2018 at 9:53 AM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
       Just musings, but... I hope they get in, and I hope that
`lua_keyin`
as well as the potential hypothetical `lua_keyvalue` include versions
that
get integers and fields for number / string arguments directly (as well
as
their raw version), making for a full suite that allows maximum
performance
and mimics the current Lua C API structure:

       [...]
We have decided that, at least for 5.4, we are not going on with
the nils-in-table proposal. Although we really like the idea, the
compatibility problems seem too big. As this message evidentiates again,
the language would need a lot of extra stuff (metamethods, API calls,
etc.), even when the option is off.

-- Roberto

: - (

That's too bad.  The behavior of holes in tables was a huge block for me
when I started using Lua (and is still a pain in the ass IMO). I think
allowing nil in tables removes a hole in the language (pun intended) and
makes tables jmore friendly for newcomers and more practical for using as
a
sequence. Are we going to have to wait another 4 years for you to tease
us
with the possibility again?

This is very disappointing news. (To be clear, the news disappoints me,
not
the people or the language. No flaming necessary).
Nils in tables will be very counterintuitive for people who for
several years have used mainly Lua. (It may be OK for some people
still used to what their previous language did.)

Some years ago, I had this bright idea. Self-initializing tables. The
first time you access tbl[i], the __index metamethod would kick in and
construct the object. Items you never access need never be
initialized. Brilliant.

Until a table in which I had initialized everything was used in `for
k,v in ipairs(tbl) do`. Work out what happened. It was painful.

It initialized everything, in order, one by one, using a very slow integer
factorization algorithm?

Or was this pre-Lua 5.3?

--
Disclaimer: these emails may be made public at any given time, with or
without reason. If you don't agree with this, DO NOT REPLY.



--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.