Subject: Re: [clisp-list] Lisp coding style

From: Fred Cohen <[email-masked]>
Date: Sun Nov 30 07:43:02 2003

Per the message sent by james anderson:
...
> if it fits on one line

> (defun factorial (n)
>    (if (< n 2) 1 (* n (factorial (- n 1)))))

> or depending on the context even

> (defun factorial (n) (if (< n 2) 1 (* n (factorial (- n 1)))))

Finally someone that agrees with me! If I could only get the list
autoformatter to undersand how code lines are related it could present
them with the relations they deserve. 

> otherwise

> (defun factorial (n)
>    (if (< n 2)
>      1
>      (* n (factorial (- n 1)))))

But this is not a coding style issue as much as a presentation issue.  I thought
the question was one of coding style - to wit:

(defun factorial (n &aux tmp) (setf tmp 1) (loop for i from 1 to n do (setf tmp (* tmp i))) tmp)

FC
-- This communication is confidential to the parties it is intended to serve --
Fred Cohen - http://all.net/ - [email-masked] - [email-masked] - tel/fax: 925-454-0171
Fred Cohen & Associates	- University of New Haven - Security Posture