[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Detecting an "empty" script?
- From: virgil@... (Virgil Smith)
- Date: Thu, 21 Aug 2003 18:18:28 -0500
Sigh, I meant to say that a chunk that has been <<run>>, not merely
>4. While it might seem somewhat strange, you can remove the text "main"
>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.