Hacker News new | past | comments | ask | show | jobs | submit login

Lua actually has a very odd syntax in that statements don't have to be separated by any particular whitespace.

    x = 1
    y = 2
and

    x = 1; y = 2
and

    x = 1 y = 2
are all equivalent.

I actually don't mind this. I've never encountered a situation where this style makes the meaning of the code undecidable.




The main Lua book points out that such code is "ugly, but valid", and leaves it at that. It seems to me that "x, y = 1, 2" would be cleaner, if someone were determined to make it a one-liner.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: