lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
I guess the same is true about removing the '\n' from strings broken
with '\'.

In C I like constant string concatenation more than backslash continuation, because strings are clearly delimited and indentation can be used to keep things tidy and aligned, both in human-written and computer-generated code:

  printf("Please make your choice:\n"
         "<R>un\n"
         "<Q>uit");

That said, I think any change introducing incompatibilities in Lua should be carefully evaluated, especially as we already have compiler concatenation (or is it the loader? I forgot and couldn't find it in the manual):

  io.write("Please make your choice:\n" ..
           "<R>un\n" ..
           "<Q>uit");

By the way, is there a high extra cost in the case of a large number of strings concatenated in this way?

  Enrico