lua-users home
lua-l archive

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




On Mon, Jan 12, 2009 at 5:23 PM, Juris Kalnins <juris@mt.lv> wrote:
On Mon, 12 Jan 2009 17:01:43 +0200, Patrick Donnelly <batrick.donnelly@gmail.com> wrote:

You should look at this thread [1].

[1] http://lua-users.org/lists/lua-l/2008-11/msg00331.html

Thank you, it has many useful things. Especially link to the Lua test
suite. This patch actually does not put any native Lua objects into
the r/o space, right? What I want is to put there any normal Lua data
(closures, tables, strings, userdata ...), and to reference it from heap values.

It actually defines two new data types (rotable and lightfunction) which live ONLY in ROM. I considered something similar for strings at some point, but gave up the idea pretty quickly, as the semantics of this new type weren't completely clear to me.
 
But such "light" CFunctions and tables are very useful, too.
They also can be implemented by setting appropriate metatable for lightuserdata.
That way it requires no change to Lua at all.

Sorry, but I don't understand how setting a metatable for the lightuserdata type is equivalent to my patch.

Best,
Bogdan