Re: ... can't be upvalue?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: ... can't be upvalue?
- From: "Aaron Brown" <arundelo@...>
- Date: 2007年8月30日 09:11:51 -0400
David Kastrup wrote:
Incidentally, {...}[i] is not allowed.
It is if you turn the table constructor into a prefixexp by
wrapping it in parentheses:
Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
-- Doesn't work:
=(function(...) return {...}[3] end)(nil, nil, "three")
stdin:1: 'end' expected near '['
-- Works:
=(function(...) return ({...})[3] end)(nil, nil, "three")
three
See <http://www.lua.org/manual/5.1/manual.html#8>.
--
Aaron
http://arundelo.com/