Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!news.tc.cornell.edu!news3.cac.psu.edu!howland.erols.net!news.mathworks.com!news.bbnplanet.com!cam-news-hub1.bbnplanet.com!uunet!in3.uu.net!uucp6.uu.net!alexandria.organon.com!alexandria!dta
From: dta@alexandria (Dean T Allemang)
Subject: Re: Bad Idiom?
In-Reply-To: Mark McConnell's message of Wed, 08 Jan 1997 09:41:17 -0600
Message-ID: <DTA.97Jan8190145@alexandria>
Sender: news@organon.com (news)
Organization: Organon Motives, Inc.
References: <vfr750E3oAzr.I5@netcom.com> <32D3C01D.74C6@math.okstate.edu>
Date: Thu, 9 Jan 1997 00:01:45 GMT
Lines: 30



In response to this question, many posters have suggested:

> (4) Above all, as a previous poster said, the best
> way to write this function is
> 
>    (mapcar #'1+ x)

which is probably the shortest solution.  On the other hand, the
original poster (and many others) complained about the difficulty in
writing/reading solutions done with the various CL looping
facilities.  The solution to this problem is just

(loop for item in x collect (1+ item))

A bit longer than the mapcar solution, but much more readable (in that
fortran sense) to non-lispers.  

Most lispers I know seem very reluctant to use the loop macro, despite
the fact that it is documented in CLTL2, and the chapter there is
quite  readable.  Is there a reason for this, other than simply it
looks "un-lispy"?

Dean

--
Dean Allemang
Organon Motives, Inc.

