lua-users home
lua-l archive

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



I wouldn't mind such a warning (not an error, really?) at block read time. Also, it could possibly be switched off by some Lua configuration "flag" or something?

Where this would help is bringing new people to Lua and smoothening their way.

The multiple assigment notation itself is powerful & nice, though, and I'd hate to remove it altogether.

-ak

Edgar Toernig kirjoittaa maanantaina, 15. joulukuuta 2003, kello 04:37:

Reuben Thomas wrote:

        local x = 10, y

This is incorrect syntax. You meant

local x, y = 10

The problem is that it *is* correct syntax but
most probably not what one wants.  If one comes
from C/C++ it's easy to make this error and Lua
accepts it silently.

Therefore the question:  Should Lua issue an error
for this condition, fewer names on the left hand
side than expressions on the right hand side?
It normally makes no sense to explicitly supply
excessive expressions.

If yes, what about regular assignment?

Ciao, ET.