Scheme Coding Style Questions

functional-programming, lisp, scheme

Solution

Here is a Lisp style guide, and here is a recommended commenting style.

If you have an emacs style editor, typing C-M-q within your s-expression should format it for you; it will get you correctly formatted code if your line breaks are reasonable (and editor configuration for indent-alist hasn't been munged too badly).

Problem

I am confused about the Scheme style for my code. Should I format if forms as: a. ``` if() () () ``` or b. ``` if () () () ``` or c. ``` if () () () ``` Should I format cond clauses as a. ``` cond () () ``` or b. ``` cond () () ``` When do I use a single ; to comment and a double ;;?

Original source