#

At a place where a command is expected, the char # serves as comment. That can be the beginning of a line or immediately after a semicolon (;). A line or bracketed [expression] beginning with # is treated as nothing.

The # differs from the construct if 0 ... such that its following words are not processed as arguments of a true procedure but instead are really ignored.

If you write this:

 if 0 [puts a]

then the output is a, followed by the prompt:

 a
 %

RJ Not in my universe:

    > if 0 {puts a}
    > 

wdb The difference is: you used curly { braces } -- I used [ brackets ] (which is not propagated as nice programming style).

If you write this:

 # [puts a]

then nothing happens:

 %

AMG: TIP 148 is relevant. If the first word of a list starts with #, it is now brace-quoted to ensure that if the list is passed to [eval], it is treated as a command rather than a comment.


See also: if 0 {