Search code examples
schemecomments

Commenting code in Scheme


I am looking at some code in Scheme from Festival and cannot seem to figure out the comments. Currently, I can see ;, ;; and ;;; used to indicate comment lines. Other sources on the web indicate that some of the above maybe ways to indicate multi-line comments. My questions are:

  1. What is the difference between ;, ;; and ;;; for commenting?
  2. When is one to be used over the other?
  3. Is there any other, IMO saner, way to comment code in Scheme?

Solution

  • The comment character is ; and anything following that on the line will be ignored. The difference is visual. I have often seen a single ; used if the comment is on a line with code, ;; if the comment is on a line by itself, and ;;; if it's a heading of some sort. The most important thing in commenting is likely to follow whatever conventions you see in the code you're working with.