[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Executing Loadstring function as part of a lua class
- From: Ben Sunshine-Hill <sneftel@...>
- Date: Mon, 12 Dec 2005 22:09:53 -0800
On 12/12/05, Michael Swan <firstname.lastname@example.org> wrote:
> -- The self doesn;t seem to make this part of class I'm executing it in.
Well, it does. But here's the thing: when you write a member function
like that, you need to explicitly declare "self" as the first
parameter. And since chunks loaded with loadstring() can't declare
argument lists explicitly, you can't have a parameter like that.
However, chunks are treated as having a vararg list. So you should be
able to access the "self" via the line "self = ...". I've never tried