[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Syntax error: 1+2 without assignment
- From: v <v19930312@...>
- Date: Tue, 29 Oct 2019 15:12:09 +0300
On Tue, 2019-10-29 at 05:07 -0700, Pavel wrote:
> Fernando Jefferson-2 wrote
> > In Lua 5.3 interpreter the expression "1 + 1
> > <enter>
> > " works perfectly.
>
> my question is not about REPL, where each line has a 'return'
> prepended if
> interpretation is failed.
>
> Actually i just realized that allowing such a C-like behavior would
> break
> the present Lua interactive interpreter as it works exactly because
> of `1+2`
> statement causes syntax error.
Try running `string.char(65)` in REPL. This is a valid function call
without return, but result is still printed.
--
v <v19930312@gmail.com>