User Tools

Site Tools


comment

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

comment [2006/07/25 21:22]
127.0.0.1 external edit
comment [2016/08/23 17:04] (current)
sgrubnick
Line 1: Line 1:
-# $EPIC: comment.txt,​v 1.2 2006/07/17 19:41:50 sthalik Exp $ 
 ======Synopsis:​====== ======Synopsis:​======
 __comment__ [<​anything>​] __comment__ [<​anything>​]
  
 ======Description:​====== ======Description:​======
-This is exactly what it says, a comment.  It does nothing. ​ It is useful +The comment ​command ​does nothing.  ​ 
-in scripts for explaining bits of code, adding disclaimers or copyright +It is important to understand that the comment command is a proper command, and follows the rules for ircII syntax.  ​ 
-notices, etc.+You can create a multi-line comment by surrounding it in curly braces
  
-There are also several symbolic comments. ​ Both the # and : characters +   ​comment { 
-may be used to designate comments. ​ There is no functional difference +      ​This ​is a multi line comment 
-between any of them.  Additionally,​ EPIC supports C /* */ multiline +      ​Isn'​t that neat? 
-comments.+   }
  
-======Examples:====== +The comment command is also known as (colon). ​ Remember that in ircII, command names are not limited, so yes, the colon is itself ​proper commandand is the comment ​command
-These are some comments: +
-      comment this was the first comment +
-      # this is a newer comment +
-      : this is a new comment toobut it isn't used much +
-      /* this is an elite comment ​unique to EPIC */+
  
-======Restrictions:====== +    ​{ 
-In order to facilitate the use of older scripts (those designed for old or +        ​This ​is another multi-line comment 
-non-EPIC clients), the default behavior ​is to recognize C-like comments only if +        This is so much less hacky than the old C-style comments! 
-they start at the beginning of a line.  This allows for '/​*'​ sequence to appear +    }
-in [[ECHO]]ed text, etc.  ​This default can be changed to the traditional C +
-behavior by setting [[set COMMENT_HACK|COMMENT_HACK]] off. There is no +
-restriction on where the closing '​*/'​ may appear. ​ Also, unlike ​C, a command +
-may not begin before a comment, and end after it; the /* */ effectively acts +
-like a line terminator.+
  
-======Other Notes:​====== +It is helpful to contrast the comment command (which is a proper ircII command) from the #-comment. 
-Executing an alias whose name begins with '​*' ​by calling ​it as '/​*'​ +The #-comment is [[load]] time thing. ​  
-will loseas it will be interpreted as comment.  ​The solution here is +#-comments are discarded ​by [[load]] and do not become part of the script when it is run. 
-to limit alias names to alphanumeric characters.+#-comments __do not__ support multi-line comments (as above), and they end at the end of the line. 
 +For this reason#-comments are better for commenting out real code 
 + 
 +The comment command __is__ retained by [[load]] because ​it is full blown command and is part of the ircII syntax.   
 +This means that comment commands are parsed each time they are encountered,​ which means you don't want to use them inside of aliases (they would slow the alias name). 
 + 
 +The standard [[load]]er supports C /* */ multi-line comments, but that is for backwards compatability. 
 +They should not be used in new code.  Use the examples above instead.
  
  
comment.txt · Last modified: 2016/08/23 17:04 by sgrubnick