[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Can I get the return values NOT adjusted to zero?
- From: Sam Roberts <sroberts@...>
- Date: Tue, 20 Jun 2006 16:59:07 -0700
I have a console, and I want people to be able to enter lua expressions
in, and see the results without having to do anything "special".
Should I just take their input, and put a "return( " before it and a ")"
after it? This seems a little hackish... is it the best way? What I
really want is the expression to not have its return stack discarded.
% lua -i
> function two() return 2 end
> two()
> return two()
2
> return( two() )
2
> return( two() + 4 )
6
> return( {"a", "b"} )
table: 0x8068b40
>
I'll have to implement __tostring for tables, I guess.
Sam