Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!news-res.gsl.net!news.gsl.net!swrinde!cs.utexas.edu!bcm.tmc.edu!pendragon!news.msfc.nasa.gov!newsfeed.internetmci.com!news.compuserve.com!ix.netcom.com!netcom.com!vrotney
From: vrotney@netcom.com (William Paul Vrotney)
Subject: Re: Parentheses readability
In-Reply-To: jesst63+@pitt.edu's message of 7 Aug 1996 02:46:38 GMT
Message-ID: <vrotneyDvt3tv.2o3@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <32068E3B.CD4@bart.nl> <4u902e$hn8@usenet.srv.cis.pitt.edu>
Date: Thu, 8 Aug 1996 06:39:31 GMT
Lines: 41
Sender: vrotney@netcom.netcom.com

In article <4u902e$hn8@usenet.srv.cis.pitt.edu> jesst63+@pitt.edu (Jeffrey E Stoner) writes:
> 
> Leo Sarasua (lsarasua@bart.nl) wrote:
> : For instance, I would write:
> : (defun foo (a)
> :   (cond ((atom a)
> : 	  (print "An atom) )
> : 	(t (print (car a))
> : 	   (foo (cdr a)) )))
> 
> : question is: Is anyone using a similar convention or is there any 
> : widespread method to improve lisp readability?
> 
> My job involves converting old C code into a 4gl.  We developed coding 
> standards for the programmers which I applied (very nicely, I think) to
> my LISP class.  In brief, I used to above procedure, starting and finishing
> a list on one line, then carried closing parenthesis' to the next line and
> adding closing comments.
> 
> For example, let me re-write your function:
> 
> (defun foo (a)
>    (cond ((atom a) (print "An atom"))
>          (T (print (car a)) (foo (cdr a)))
>    ) ;;; end COND
> ) ;;; end function foo
> 
> It makes for longer source listings but improves readability and finding
> mis-matched parenthesis', especially for long CONDs, IFs, LOOPs, etc..
> 

All of you who are making these suggestions need to study and use Emacs
s-expression operations for awhile and then re-think your suggestions.
There is really no need for these kinds of conventions for on line code if
modern tools are used.  And for hardcopy Lisp code as long as it is indented
properly why do you care about closing parentheses?


-- 

William P. Vrotney - vrotney@netcom.com
