[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: New long comments in 5.1
- From: Jadek <jadek@...>
- Date: Sun, 20 Jun 2004 11:39:00 -0400
> "little chance of them appearing in normal code"?
> What about content of strings, or nested comments?
You just have to look to existing lua conventions for the answer to that...
Comments inside strings aren't parsed. Try the following in lua:
var = "test -- test"
print( var )
If you were to parse comments inside strings, then any set of comment
could appear validly in the language.
As for nested comments, this is a perennial problem which occurs wherever block
comments are allowed. There's two solutions - Allow them or don't... But do
it consistently. Both have their advantages and disadvantages, and the only
reason it's such an issue in C/C++ is that there is no specification for how to
handle nested block comments. Hence certain compilers do it one way, and other
compilers do it the other way.
Regarding /* */, I have nothing against them, however they don't quite mesh
the line comment style. Also, at least one case has been brought up where they
could appear in valid code. Not that this isn't a concern in C/C++, mind
At 05:28 AM 6/20/2004, you wrote:
Tom Spilman wrote:
-# Jadek #-
I like this... two characters... little chance of them appearing in normal
code... similar to C/C++ comments. What's the problem with using this?
"little chance of them appearing in normal code"?
What about content of strings, or nested comments?
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist