[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: sunday afternoon whishlist
- From: Patrick Donnelly <batrick@...>
- Date: Tue, 11 May 2010 13:22:59 -0400
On Tue, May 11, 2010 at 12:53 PM, HyperHacker <hyperhacker@gmail.com> wrote:
> I'm sure I've heard it repeatedly stated that vararg would change in
> 5.2 in this very list. Also:
>> function f(x,...) print(#...) end
>> f(1,2,3,4)
> stdin:1: attempt to get length of a number value
> It doesn't work, because "#..." expands to "#2,3,4" which doesn't make sense.
The error message was pretty clear. Try this:
batrick@neverwinter:~$ lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> function f(...) print(#...) end
> f("foo")
3
--
- Patrick Donnelly