lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Apr 6, 2009 at 4:24 PM, Thomas Harning Jr. <harningt@gmail.com> wrote:
> This could be fixed by updating the wrapping of var-args from:
> local args = {...}
> to
> local args = {n = select('#', ...), ...}
>
> and update iteration:
> for i, v in ipairs(args) ....
>
> to
>
> for i = 1, args.n do
>  local v = args[i]
> ..
> --
> Thomas Harning Jr.
>

This fixes the first two cases, but the last case (_3, _3, _3) is still odd:

bbind (print,_3,_3,_3) (1,2,3) --> 3  3  3
bbind (print,_3,_3) (1,2,3) --> table table; should be 3  3?
bbind (print,_3) (1,2,3) --> table; should be 3?

It seems that placeholder _N can only be used if there are at least N
placeholders.