lua-users home
lua-l archive

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


| I can only say that i quickly got used to the -- syntax for line comments,
| but i have to agree on the missing block comments: this really bites. And
| since Lua 4.0, the "$if nil" mechanism doesn't exist any more!
| Here is what i use if i have to disable a large block of code:
|
| local commented_out = [[
| whatever( code, you + want [ disabled ] );
| ...
| ]]
|
| this is of course creating an unused string - ouch.


Missing block comments and no conditional compilation is bit of a pain
sometimes.

The other method is just to add macros to your editor... Eg VB. for MSVC

Sub LuaCommentOutCurrentLine()
 ActiveDocument.Selection.StartOfLine dsFirstText
 ActiveDocument.Selection.StartOfLine
 ActiveDocument.Selection = "--"
 ActiveDocument.Selection.CharLeft dsMove, 2
 ActiveDocument.Selection.LineDown
End Sub

Perhaps useful Lua macros for editors as well as syntax highlighting could be
added to the LuaTools page...

Nick