[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: functions and upvalues
- From: "Wesley Smith" <wesley.hoke@...>
- Date: Thu, 31 May 2007 13:06:13 -0700
Yes, I could, but image there are 30 or 40 of these functions. The
constructor would get rather long. The real goal here is to pass in
functions that describe behaviors to the constructor. Sometimes,
these behavior functions need data from the constructor itself. I
guess I could reorganize my constructor to take a table instead of a
list of values and pass the table into the function instead. That
way, I can write a small constructor and general functions outside of
On 5/31/07, Roberto Ierusalimschy <firstname.lastname@example.org> wrote:
> What I'd like is f1's val upvalue to refer to constructor's local
> variable val. Is this possible somehow through environments?
Can't you define 'gen1' inside the constructor?