lua-users home
lua-l archive

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

On Wed, 27 May 2009 08:47:38 +0200
steve donovan <> wrote:
> Have a look at:
> RAII (so beloved of C++) is a very useful pattern

Thank you. I must have overlooked that since I wasn't intending to add
syntax. This should help with the linkset, since only a deranged script
would dare copy an active iterator to a global variable.

For the event data, I found that it's a reference-counted pointer
already, so I can just increment that, and it doesn't matter how long it
takes the data to be collected.

Out of curiosity, what are the pros and cons of the __copy metamethod?
The last discussion of this I found[1] ended without a clear answer. A
difficulty I forsee is that you'd also need copy-on-write, else you'll
waste a lot of time copying values when a reference would suffice. 


-- tom