lua-users home
lua-l archive

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


	Hi Henk

On 25 May 2010 14:22, Tomas Guisasola Gorham <tomas@tecgraf.puc-rio.br> wrote:
       Sure.  However, the "body" of a function is a chunk isn't it?
I thought it should have a different (local) _ENV like the above code?

The body of a function is a block, not a chunk. As Roberto said (and
as hinted in the manual), a chunk is a compilation unit.
	I checked the "Complete Syntax of Lua" (chapter 9 of 5.2 docs):

	function ::= function funcbody
	funcbody ::= '(' [parlist] ')' block end
	block ::= chunk

	Maybe I'm missing something...
		Tomás