Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!newsfeed.internetmci.com!in1.uu.net!netnews.jhuapl.edu!aplcenmp!hall
From: hall@aplcenmp.apl.jhu.edu (Marty Hall)
Subject: Re: Need ugly lisp code!
Message-ID: <DoIoAC.Gps@aplcenmp.apl.jhu.edu>
Keywords: lisp, ugly
Organization: JHU/APL Research Center, Hopkins P/T CS Faculty
References: <4ikqj6$dop@wumpus.its.uow.edu.au>
Date: Tue, 19 Mar 1996 13:32:36 GMT
Lines: 48

In article <4ikqj6$dop@wumpus.its.uow.edu.au>
bme01@wumpus.its.uow.edu.au (Ben Mackenzie Edmondson) writes: 

>	I was wondering if some of you lisp experts could send me their 
>favourite bit of ugly looking lisp code. I am doing a seminar and want to talk
>about how hard lisp is to read. I have some prettyhorrible examples but I need
>some real shockers. So if you send me something with lots of parentheses
>(should be pretty easy) I would be much obliged.

You can make up arbitrarily nested examples yourself just using the
"*" and "+" operators.

Note, however, that Lisp programmers don't look at the parens at all
when they read Lisp code. They look at the indentation (which
indicates nesting level) and ignore the parens altogether. When they
write Lisp code, they use vi or emacs or any editor that automatically
balances the parens; they never, never count parens. Both of those
editors and almost all other editors a Lisp programmer would use also
can automatically indent for you.

For instance, a Lisp programmer can read

Foo
  Bar A B
  Baz C 
      Fubar D
  Boo E F

just as easily as

(Foo
  (Bar A B)
  (Baz C
       (Fubar D))
  (Boo E F))  

The point is the nesting level (indicated by the indentation), not the
parens. There are many serious pros and cons in using Lisp. But nobody
who has gotten even a tiny knowledgeable introduction to Lisp
considers the parens to be one of those issues. I've been teaching
students AI and AI Programming for 8 years or so, and I get people who
love Lisp and who hate Lisp. But for none of them is the parens the
issue. (Hmm, I hope I am not naively responding to deliberate
trolling).

						- Marty
(proclaim '(inline skates))
http://www.apl.jhu.edu/~hall/lisp.html
