Re: New long comments in 5.1
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: New long comments in 5.1
- From: Philippe Lhoste <PhiLho@...>
- Date: 2004年6月19日 13:23:10 +0200
Philippe Lhoste wrote:
Just one thought:
Block comments and literal strings are mostly meant for enclose large
number of lines (less for literal strings that are useful, amongst other
strings, to enclose Dos paths). At least, that's where there is the most
likely potential problems.
Literal srings have already some conventions, like if they start by a
new line, it is not enclosed in the string.
Why not make another convention, like starting (some) multiline block
comments (literal strings) with --[[[ ([[[) anywhere in a line and
ending them with ]]] (or --]]] as it is convenient) only at the start of
line, a bit like the Perl/PHP HereDoc?
It lifts a lot of potential problems, as we rarely find code like:
val = t[a[f[i
]]] * 2;
aren't we?
Or, if really we want to take care of all cases, we can use the HereDoc
syntax:
longText = [[TERMINATOR
blabla
...
42
...
foo bar
TERMINATOR]]; -- Always at start of line
--
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://Phi.Lho.free.fr
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--