[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Feature request: per-value uservalue
- From: Tim Hill <drtimhill@...>
- Date: Fri, 24 Mar 2017 13:16:51 -0700
> On Mar 24, 2017, at 10:26 AM, Coda Highland <chighland@gmail.com> wrote:
>
>
> Well yes, of course, you make a weak-valued table with lightuserdata
> keys and full userdata values and marshal your pointers through that,
> but it's not immediately obvious and there are a number of possible
> pitfalls in the implementation (for example, forgetting that
> weak-valued tables are a thing makes this solution either ridiculously
> leaky or annoyingly difficult to maintain).
>
> This has come up a number of times before, so while I don't think that
> "per-value metatables" is the right solution to the task, it does at
> least indicate that the issue is fairly common.
>
I don’t think is a particularly complex design pattern, but I do agree it might be one that is worth documenting somewhere (in the wiki perhaps?). In any case the OP was suggesting a core design change in Lua as a solution when I think this pattern does all he needs.
—Tim
- References:
- Feature request: per-value uservalue, Xavier Wang
- Re: Feature request: per-value uservalue, Tim Hill
- Re: Feature request: per-value uservalue, 云风 Cloud Wu
- Re: Feature request: per-value uservalue, Tim Hill
- Re: Feature request: per-value uservalue, 彭 书呆
- Re: Feature request: per-value uservalue, Tim Hill
- Re: Feature request: per-value uservalue, 彭 书呆
- Re: Feature request: per-value uservalue, Tim Hill
- Re: Feature request: per-value uservalue, Coda Highland
- Re: Feature request: per-value uservalue, Thomas Jericke
- Re: Feature request: per-value uservalue, Coda Highland