[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Getting a reference to the current function
- From: "Gavin Kistner" <gavin.kistner@...>
- Date: Wed, 4 Oct 2006 12:02:37 -0600
From: Gavin Kistner
> The reason I'm asking is I want a way to associate some
> userdata objects
> with a function so that the function always has access to them.
Er...duh. I forgot that Lua functions are first-class objects, but that
objects in Lua are not necessarily tables. Hence, no way to assign
custom properties to them.
Does anyone have any suggestions on how to pre-allocate a few userdata
objects and associate them with a specific function, so that when that
function is called (from different 'scopes' as the self using Lua's OOP
syntax sugar) you can access them?