[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Challenge] Smallest table copy
- From: Pierre-Yves Gérardy <pygy79@...>
- Date: Thu, 8 May 2014 20:11:01 +0200
On Thu, May 8, 2014 at 5:35 PM, Philipp Janda <siffiejoe@gmx.net> wrote:
> Am 08.05.2014 17:24 schröbte Pierre-Yves Gérardy:
>> L="local a,b,c=..."load(L.."")load(L.."")
>> function(a,b,c)endfunction(a,b)end
>
>
> Yes, and we also rely on upvalues, so we would need the `function` keyword
> in there after all ...
> But for a moment it was a good idea.
No need for upvalues, a Lua chunck really is a vararg function:
add = load"local a,b = ... return a + b"
add(1,2) --> 3
—Pierre-Yves
- References:
- [Challenge] Smallest table copy, Thiago L.
- Re: [Challenge] Smallest table copy, Daniel Stephens
- Re: [Challenge] Smallest table copy, Hans Hagen
- Re: [Challenge] Smallest table copy, Thiago L.
- Re: [Challenge] Smallest table copy, Paul K
- Re: [Challenge] Smallest table copy, Daniel Stephens
- Re: [Challenge] Smallest table copy, Thiago L.
- Re: [Challenge] Smallest table copy, Philipp Janda
- Re: [Challenge] Smallest table copy, Pierre-Yves Gérardy
- Re: [Challenge] Smallest table copy, Philipp Janda