lua-users home
lua-l archive

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




On Saturday, May 3, 2014, Coroutines <coroutines@gmail.com> wrote:
On Sat, May 3, 2014 at 3:28 PM, Philipp Janda <siffiejoe@gmx.net> wrote:

> And it wasn't at that time. The ability to use arbitrary uservalue values
> will (most likely) come with Lua 5.3.

Yes, I'm saying I identified that hole (me me meeeee) -- as you could
only associate a table to userdata, and the best you could do to save
on memory would be to share that table among the userdata you create
and make that table weakly-referenced to get from it the userdata you
would have otherwise paired directly.  IIRC, Luiz gave me that
solution, but it was the best you could do and I remember reading a
lot of replies that weren't working within my constraints for the
problem.  The main concern was memory use, as I was creating a lot of
userdata.

Then it led off on that tangent about libraries segfaulting and from
there on I was still right all the time.  Yep, rereading the thread
confirms.

> Some (most?) people who propose a change to Lua have an actual problem they
> would like solved, and a new feature can only solve it in future Lua
> versions (if accepted at all), so suggestions how one can tackle the problem
> in current Lua versions might be appreciated.

I did appreciate the [best] solution I got from (Luiz?) -- it just
took a lot of wading through "Well why would you..." at the beginning.

This thread beautifully illustrates the point of my original email. You had a proposal. After a bunch of drama, the problem to be solved and it's value came to light and progress was made.

Skip the proposal and the drama. Imagine if you started with the problem that you were having and had asked for the reason why uservalues could only hold tables?

There are other approaches, too. The point is that the proposal caused the drama and only after gracious patience was the meaning behind the proposal discovered. 

Or not. 

-Andrew