[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Confusive text in Lua doc "Variable Number of Arguments" about "arg"
- From: Andrew Gierth <andrew@...>
- Date: Thu, 09 Sep 2021 12:11:40 +0100
>>>>> "Philippe" == Philippe Verdy <verdyp@gmail.com> writes:
Philippe> This is quoted from Lua 5.2
No it's not, it's from _section 5.2_ of the book about Lua 5.0.
Philippe> And this is the only text available on official site lua.org
It is the only text _of the book_ there, because the updated editions of
the book cost actual money to buy.
The reference documentation for 5.2 which can be found at
https://www.lua.org/manual/5.2/ covers this issue under "function
definitions".
Philippe> Version 5.2 really had the implicitly declared local variable
Philippe> "arg",
5.0 had that, 5.1 deprecated it in favour of ..., and 5.2 removed it.
This is trivially verified by experiment:
$ lua51 -e 'arg="foo" (function(...) print(arg) end)(1)'
table: 0x...........
$ lua52 -e 'arg="foo" (function(...) print(arg) end)(1)'
foo
--
Andrew.