Comments

Interspersed throughout a program you can find comments, which is text to explain code to humans and ignored by Red. A comment starts after a semicolon (;at the start or in the middle of a line:

;-- see Chapter03/comments.red:; single-line commentprint "start" ; comment on a code line

A multiline comment is formed as follows:

comment {    This is a multiline comment.    This explains how this program works.}

From the next section on, we will show the return value of a word on the same line in a comment starting with ;== like this—;== value. However, == is also the way the REPL shows the return value, so this should be familiar.

Make multiline comments using several single-line comments (Visual Studio Code has a menu-item for this—Edit ...

Get Learn Red - Fundamentals of Red now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.