www.delorie.com/gnu/docs/m4/m4_39.html   search  
 
Buy GNU books!


GNU macro processor

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.3 Changing comment delimiters

The default comment delimiters can be changed with the builtin macro changecom:

 
changecom(opt start, opt end)
where start is the new start-comment delimiter and end is the new end-comment delimiter. If any of the arguments are void, the default comment delimiters (# and newline) are used instead of the void arguments. The comment delimiters can be of any length.

The expansion of changecom is void.

 
define(`comment', `COMMENT')
=>
# A normal comment
=># A normal comment
changecom(`/*', `*/')
=>
# Not a comment anymore
=># Not a COMMENT anymore
But: /* this is a comment now */ while this is not a comment
=>But: /* this is a comment now */ while this is not a COMMENT

Note how comments are copied to the output, much as if they were quoted strings. If you want the text inside a comment expanded, quote the start comment delimiter.

Calling changecom without any arguments disables the commenting mechanism completely.

 
define(`comment', `COMMENT')
=>
changecom
=>
# Not a comment anymore
=># Not a COMMENT anymore


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003