Comments
Single-line comments
A single-line comment starts with # and extends to the end of the line.
Multi-line comments
A multi-line comment starts with #` and followed by the commented text enclosed by bracketing characters (e.g., (), [], {}, 「」, etc.).
Multi-line comments can also be embedded into code.
Using more than one bracketing character lets you include an unmatched close bracket, as shown below.
Pod comments
Pod also provides declarator blocks which are special comments that attach to some source code and can be extracted as documentation. They are either #| or #= and must be immediately followed by either a space or an opening curly brace. In short, blocks starting with #| are attached to the code after them, and blocks starting with #= are attached to the code before them.
Last updated
Was this helpful?