lua-users home
lua-l archive

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


On Friday 18 June 2004 12:30, Tom Spilman wrote:

> Does --[[ this (i.e., the current style) ]] seem ridiculous?
>  I think it's reasonable.
>  Give them a break...

I agree that it's not such a big issue, since there are work-arounds for all 
of the gripes (I use line comments for the entire region).

But since the lid has opened on Pandora's Box, I'll throw my opinion in the 
mix.

I find it unfortunate that Lua uses two characters that could be used together 
- and often are - as its long comment delimiter. In C/C++, there is no 
reasonable use of /* or */ in an actual chunk of code (other than strings, 
and there's no protecting of that). In Lua, the sequence ]] can be found in 
many chunks of code.

I like using '--' at the beginning of the closing comment. That way we're 
guaranteed that it won't be found in any (non-literal-string) code.

--[
  print('current value of a=' .. a:tostring())
--]

Not symmetrical, I know, but I think it meets most of the other criteria.

Doug

-- 
--__-__-____------_--_-_-_-___-___-____-_--_-___--____
Doug Rogers - ICI - V:703.893.2007x220 www.innocon.com
-_-_--_------____-_-_-___-_--___-_-___-_-_---_--_-__-_