lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thursday, June 18, 2015 01:12:27 PM Dirk Laurie wrote:
> Correctly so, Open parenthesis as a way to claim the next line as
> a continuation is a Python convention. Not Lua.
> 

A Lua expression may be enclosed in a parenthesis and it is still an 
expression. There's nothing pythonic about that. And the Lua interpreter has 
also made use of it.

> x = (1
>> + 1)
>

If the interpreter is going to accept expressions then it should do so without 
quirky corner-cases.

> 1 + math.random()
1.8401877167635
> 1 + math.random(
stdin:1: unexpected symbol near '1'
> math.random()
0.39438292663544
> math.random(
>> )
>

-- 
tom <telliamed@whoopdedo.org>