Re: Lua intepreter does not print results for multiline input
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Lua intepreter does not print results for multiline input
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2014年10月26日 14:51:39 +0200
2014年10月26日 13:19 GMT+02:00 张睿 <zrui16@hotmail.com>:
> In lua 5.3 intepreter:
>
>> table.unpack{1,2,3}
> 1 2 3
>> table.unpack{
>>> 1,2,3
>>> }
>>
>
> The intepreter does not print results for the second input, which has multiple lines.
Correct. This is what the documentation says it should do.
| After reading a line, Lua first try to interpret the line as an expression.
| If it succeeds, it prints its value. Otherwise, it interprets the line as
| a statement. If you write an incomplete statement, the interpreter
| waits for its completion by issuing a different prompt.
> However, adding the prefix '=' works fine.
Because '=' is replace by 'return'.