From: André Thieme
Subject: Indention
Date: 
Message-ID: <c115og$2hj$1@ulric.tng.de>
When using the auto-indention of LispWorks personal I get code like this:


(if t
     'true
   'false)

So the 'true and 'false are not in the same column.
However, when reading Grahams Ansi CL book I see the "if" like this:

(if p
     (+ p 1)
     nil)

Here the "then" and the "else" blocks are in the same column.

Which of these styles do you personaly use.. and is there a "right" 
version? If someone maybe knows how I can teach LispWorks to change they 
way it indents "if" please let me know, thanks.



Regards,
Andr�
-------------
"If Java is your hammer, every problem looks like a thumb"
From: James Bielman
Subject: Re: Indention
Date: 
Message-ID: <m2d68b4w3y.fsf@haytonsystems.com>
On 18 Feb 2004, ······································@justmail.de wrote:

> When using the auto-indention of LispWorks personal I get code like
> this:
>
> (if t
>     'true
>   'false)
>
> So the 'true and 'false are not in the same column.
> However, when reading Grahams Ansi CL book I see the "if" like this:
>
> (if p
>   (+ p 1)
>   nil)
>
> Here the "then" and the "else" blocks are in the same column.
>
> Which of these styles do you personaly use.. and is there a "right"
> version? If someone maybe knows how I can teach LispWorks to change
> they way it indents "if" please let me know, thanks.

Personally, I prefer the latter.  I believe the first indentation
style is an artifact from other dialects of Lisp in which the else
clause of IF is an implicit PROGN, which is not the case in CL.
(Emacs Lisp IF works this way, for example).

Evaluating the following (or placing it in '.lispworks' for LW Pro and
above) will get the LW editor to use the second style:

   (editor:setup-indent "if" 1)

You can see the default indentation settings for the editor in the
$LISPWORKS_DIR/config/indents.lisp as well.

James