[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Detecting an "empty" script?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 21 Aug 2003 19:20:09 -0300
>4. While it might seem somewhat strange, you can remove the text "main" from
>your example script. A loaded chunk has a return value. In the absence of
>an explicit return statement, the return value is the value of the last
>expression evaluated, so running a script that says....
>will return a function that takes 3 parameters, and you can store off this
>function and call it either immediately or later.
Not true. There is no implicit return value. You're mistaking the function
that represents the "main" part of the chunk (which is what lua_load leaves
on the stack) for this.