Re: When to open the repository



James Amundson:
> By default, emacs will indent "if" as follows:
> 
> (if (condition)
>     (true-case)
>   (false-case))
> 
[James prefers:]
> (if (condition)
>     (true-case)
>     (false-case))

What you're calling the Emacs convention was in fact introduced -- if
I remember correctly -- in the extensible version of the Gosper
pretty-printing program Grind -- written I think by Ira Goldstein in
about 1975, about the time that the earliest version of Emacs was
written by Stallman.

I disliked it when it was first introduced because I figured that
indentation should reflect the parenthesis structure.  But the problem
is that Lisp's logical structure does not always correspond to the
parenthesis structure: some special forms (also called
pseudo-functions) treat the first argument specially (let, when,
while, case, lambda, function) or the first two arguments specially
(do, if), and I find it useful to have the indentation reflect that. 
(Then there are prog1 and prog2, true functions which have special
roles for the first or second argument...)  Consider the difference
between

(if (condition)
       (true-case)
    (false-case))

and

(when (condition)
    (first-true-clause)
    (second-true-clause))

WIth the Emacs convention, it is clear that the structure is very
different, and it helps avoid the easy-to-make error:

(if (condition)
    (true-case)
    (second-clause-of-true-case OOPS))

Does Common LIsp in fact make the other convention official?

---------------------------------

> I came across another small problem while re-indenting the code. There
> are many comments in the code that begin at the very left, but start
> with a single ";". Emacs will indent these to the middle of the page.
> ... Emacs leaves double-; comments flush left.

The convention I learned -- which is still used by Emacs, at least the
way I have it configured -- is that triple-;;; is never reindented
automatically and normally starts at the left margin; double-;; is
aligned at the same place that a piece of code would be and normally
is used alone on a line; and single-; starts at the comment column,
e.g.:

  (divcarcdr
;;; left-aligned comment
   (expanintexpt
    ;; inline comment
    (cons (power (add abs (car ris)) (1//2)) ; comment-column comment

--------------

          -s