Style: Comments

Lisp ignores the rest of a line after a ; character. This feature allows comments to be included in a program.


   ;;; edited 25 Aug 2000 by GSN
   ;;; Compute factorial of an integer n.
   ;;; n should be non-negative.
   ;;; 1 is returned for negative numbers.
   (define (factorial n)
     (if (<= n 0)          ; <= for safety
         1                 ; base case
         (* n (factorial (- n 1))) ) )

Document your code well with comments that describe:

Rule: Document unto others as you would have others document unto you.

Contents    Page-10    Prev    Next    Page+10    Index