Subject: Re: Lisp readability
From: rpw3@rpw3.org (Rob Warnock)
Date: Tue, 24 Aug 2004 04:43:58 -0500
Newsgroups: comp.lang.lisp
Message-ID: <LqednaQOW8FDkLbcRVn-vw@speakeasy.net>
neo88 <solo88@truevine.net> wrote:
+---------------
| (defun foo (args)
|   (cond ((args null) nil)
|          (t (do_stuff_with_args_here))))
+---------------

Personally, I almost always go with the alternate COND style which
costs an extra vertical line but is (IMHO) *much* easier to read:

  (defun foo (args)
    (cond
      ((args null) nil)
      (t (do_stuff_with_args_here))))

Then if the consequence clauses get long, the even longer style
of only the test on the first line of the clause, despite the fact
that some of the clauses are short:

  (defun foo (args)
    (cond
      ((args null)
       nil)
      (t
       (do_stuff_with_args_here)
       (do_more_stuff_with_args_here)
       (and_more_stuff)
       (and_more)
       (and_some more))))

But I never (well, seldom!) mix those two styles in a single COND.


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607