lua-users home
lua-l archive

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


Technically the first will be more expressive in text editors with
syntax highlighting, as it all gets highlighted as a comment.  The
second uses in-place preprocessor directives, in vim only those lines
are highlighted as the comment color :>  So clarity over clarity is
not clear :D

On Fri, Feb 19, 2010 at 10:22 AM, Jonathan Castello <twisolar@gmail.com> wrote:
> Aww, but that's not as fun! ;)
>
> ~Jonathan
>
> On Fri, Feb 19, 2010 at 6:43 AM, Luiz Henrique de Figueiredo
> <lhf@tecgraf.puc-rio.br> wrote:
>>> *laughs* In case you're curious, the original C++ comment abuse looked
>>> like this:
>>>
>>> /*/
>>>   std::cout << "One" << std::endl;
>>> /*/
>>>   std::cout << "Two" << std::endl;
>>> //*/
>>>
>>> You just change the first /*/ to /**/ to toggle, and the second /*/ to
>>> // to disable both. I actually believed I couldn't do this in Lua,
>>> until I read that multi-line comments also supported [=[ ]=] syntax!
>>
>> I'd rather use
>>
>> #if 0
>>  std::cout << "One" << std::endl;
>> #else
>>  std::cout << "Two" << std::endl;
>> #endif
>>
>> and toggle 0 to 1. It seems much clearer to me.
>>
>