lua-users home
lua-l archive

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


On 12/12/2009 11:18, spir wrote:
Tobias Kieslich <tobias@justdreams.de> dixit:
--[=[ --]=]

I wondered when somebody would point out at that...

Thanks for the explaination. Precisely I wondered about nested
comments' use case. (About the purpose of such a complicated syntax
for comments and string.) What about nested (multiline) strings?

Search "Literal strings" in the manual, it explains this, and the fact you can nest at several levels. Same (similar) syntax for multiline comments and strings. BTW, I don't find this syntax "complicated". You have to do something a bit convoluted so the end of comment/string isn't meet usually in the text they surround. In the past, Lua has only [[ and ]] and people were meeting the a[b[c]] problem, so they added the [=*[ ]=*] syntax.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --