[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: assignment in conditional expression?
- From: David Jeske <jeske@...>
- Date: Tue, 8 Dec 1998 16:12:40 -0800
On Tue, Dec 08, 1998 at 09:49:14PM -0200, Luiz Henrique de Figueiredo wrote:
> this is where upvalues enter! check this out:
>
> function correlate_data(tbl1,tbl2)
> local output_tbl = {};
>
> for(1,2,function (x) -- use the 'for' *function*
> %output_tbl[x] = %tbl2[%tbl1[x]]; -- see the upvalues!
> end);
>
> return (output_tbl); -- no need for parentheses here
> end
>
> this should work.
I never did understand how upvalues were supposed to work. This looks
cool, I'll try it out.
--
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net