Go to the first, previous, next, last section, table of contents.

Comments (Hunk C)

==================================================================
Hunk C starts here:
==================================================================

[ Should I say this earlier, and use comments in examples earlier? ]

You can and should put comments in your Scheme programs. Start a comment with a semicolon. Scheme will ignore any characters after that on a line. (This is like the // comments in C++.)

For example, here's a variable definition with a comment after it:

(define foo 22) ; define foo with an initial value of 22

Of course, most comments should tell you things that aren't patently obvious from looking at the code.

Standard Scheme does not have block comments like C's /*...*/ comments.

It is common to use two or three semicolons to start a comment, rather than just one. This makes the beginning of the comment stand out more than a single semicolon. The extra semicolons are ignored, along with all other characters up to the end of the line.

A common style is to use two semicolons for most comments, and three for comments that take up a whole line, or which describe the contents of a file.


Go to the first, previous, next, last section, table of contents.