REBOL 3 Docs | Guide | Concepts | Functions | Datatypes | Errors |
TOC < Back Next > | Updated: 23-Feb-2009 Edit History |
Commenting is useful for clarifying the purpose of sections of a script.
REBOL provides several types of comments:
In headers | Every script begins with a scripts: headers which can provide general information about the script, including its title, purpose, author, and more. |
In functions | Functions often include embedded title comment and argument comments. These are part of the function! specification, and are used for functions like help. |
Embedded | Comments can be embedded within code, and will be kept with the code, even when it is loaded. |
Lexical | Lexical comments only appear in the source code and get stripped out when the is loaded. |
A single-line comment is made with a semicolon. Everything following the semicolon to the end of the line is part of the comment:
zertplex: 10 ; set to the highest quality
You can also use strings for comments. For instance, you can create multi-line comments with a string enclosed in braces:
{ This is a long multilined comment. }
This technique of commenting works only when the string is not interpreted as an argument to a function. If you want to make sure that a multi-line comment is recognized as a comment and is not interpreted as code, precede the string with the word comment :
comment { This is a long multilined comment. }
The comment function tells REBOL to ignore the following block or string.
TOC < Back Next > | REBOL.com - WIP Wiki | Feedback Admin |