lua-users home
lua-l archive

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


> Is there a reason why adjacent constant strings are not considered as a
> single string, like in C?

Yes.

> For example, this is not allowed in Lua:

> Show("Suppose this is a long string "
>      "broken in two lines for readability")

In Lua, a string following a token is a function call. So you could write:

Show "Suppose this is a long string"

instead of

Show("Suppose this is a long string")

Consequently,

Show "Suppose this is a long string " "broken in two lines for readability"

would call Show with the first string, and expect that to return a function
which would then be called with the second string.

I don't know if Lua does constant pre-evaluation at compile time but I
doubt it.