lua-users home
lua-l archive

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



On Dec 13, 2005, at 06:40, Michael Swan wrote:

-- 15:36:22: LUA: [string "..."]:1: attempt to index global `self' (a nil value)

I guess you need to add 'self' to your function signature:

local aString = "return function( self ) return self .. 'hello' end"
local aChunk = loadstring( aString )
local aFunction = aChunk()

print( aFunction )

> function: 0x128690

aProxy.method = aFunction

print( aProxy:method() )

> LUProxy@1214720hello

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/