lua-users home
lua-l archive

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


On Sun, May 24, 2020 at 3:34 PM Philippe Verdy wrote:
> Oops, you're right.
> I rarely use long brackets, and absolutely never after an identifier for an implicit function call without parentheses, or after any other expression. Long brackets litterals (with [[...]] or [=[...]=] or with longer matching sequences of "=") are very rarely used (unlike long comments where "[[...]]" or "[=[...]=]" or al. immediately follows "--")

Actually I use long strings as the only argument of a function quite
often when quoting shell command line, e.g.

os.execute[[ grep 'blabla$' > "my file.txt" ]]

> In fact long brackets cause various issues for code maintenance,
> Notably you can't comment out some parts of long-brackets string literals.

For me, they work quite well, e.g. I can change

print[[ debug bla bla ]]
...
print[[ debug bla bla ]]

with

--[=[
print[[ debug bla bla ]]
...
print[[ debug bla bla ]]
--]=]