[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Executing Loadstring function as part of a lua class
- From: PA <petite.abeille@...>
- Date: Tue, 13 Dec 2005 07:02:13 +0100
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/