Re: when do programs set metatable?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: when do programs set metatable?
- From: Doug Rogers <rogers@...>
- Date: 2008年2月08日 14:00:50 -0500
Roberto Ierusalimschy wrote:
> Among other things, this change could open the doors for __gc
> metamethods for tables.
Ah, the other direction!
When I ran my first experiments with __gc, I had encapsulated my
userdatum in a table so that I could attach other fields from Lua. I was
surprised when the C objects were not collected (the metatable was
attached to the table, not the userdatum). Then I read the fine print,
so I removed the table and used the userdatum directly.
I'm sure many would love to have this feature.
Doug
--
Innovative Concepts, Inc. www.innocon.com 703-893-2007 x220