lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Luiz Henrique de Figueiredo wrote:
>>How to handle nil arguments in vararg functions?
>
>
> Nil args are handled fine. The exact number of args passed to a vararg
> function is the result of select('#',...).

Ah, ok. Looks nice. Btw:

  function pack(...)
    return arg
  end

  t = pack()

  print(t.n) ---> "0"


Is the arg.n field inside vararg functions by design?

So the "only" problem left is that arrays with holes are not smart and I
have to handle the array length myself?

As I seen, unpack() can handle explicit sized arrays now.


cu

Michael
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDJ1mJSIrOxc3jOmoRAugeAKCWzMwzcEhmHt4yCe9jwaZGPjDtFQCeI6d0
KXZFId9TDLkALQCAHowwGDU=
=SAbZ
-----END PGP SIGNATURE-----