[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Can I get the return values NOT adjusted to zero?
- From: Sam Roberts <sroberts@...>
- Date: Wed, 21 Jun 2006 09:07:12 -0700
On Tue, Jun 20, 2006 at 10:45:11PM -0400, Aaron Brown wrote:
> Sam Roberts wrote:
>
> >But wait... looking a lua.c, I see that it appears to be
> >using "=" as a short hand for "put return at the start of
> >this line".
>
> Yep. If you don't want the user to have to type "=" or
> "return ", and you also want them to be able to type
> statements or blocks of statements as well as expressions, a
> trick for doing this without needing to parse the user's
> input is briefly described at
>
> http://lua-users.org/lists/lua-l/2005-04/msg00159.html
Load it with return at the front, then load it again without if there
was a syntax error. I like it, thanks.
Sam