Multiline comments

Starting with version 0.13.0 of the language Nim supports multiline comments. They look like:

  1. #[Comment here.
  2. Multiple lines
  3. are not a problem.]#

Multiline comments support nesting:

  1. #[ #[ Multiline comment in already
  2. commented out code. ]#
  3. proc p[T](x: T) = discard
  4. ]#

Multiline documentation comments also exist and support nesting too:

  1. proc foo =
  2. ##[Long documentation comment
  3. here.
  4. ]##

You can also use the discard statement together with triple quoted string literals to create multiline comments:

  1. discard """ You can have any Nim code text commented
  2. out inside this with no indentation restrictions.
  3. yes("May I ask a pointless question?") """

This was how multiline comments were done before version 0.13.0, and it is used to provide specifications to testament test framework.