From: paul_ru...@scientia.com Subject: Re: PROGN considered intrusive? Date: 1999/03/23 Message-ID: <7d7j9g$ca9$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 457891039 References: <3131012851256245@naggum.no> <7d400a$9b9$1@nnrp1.dejanews.com> <3131062658198428@naggum.no> <36F6CC00.2D6DFA2A@simplex.nl> X-Http-Proxy: 1.0 x4.dejanews.com:80 (Squid/1.1.22) for client 194.216.183.192 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Tue Mar 23 08:27:36 1999 GMT Newsgroups: comp.lang.lisp X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 95) In article <36F6CC00.2D6DF...@simplex.nl>, Arthur Lemmens wrote: > Now that I understand LOOP a bit better, I know why it's often better > to use LOOP (although I still don't like the syntax): > > it's more resistant to change. > > It captures the essence of what you want to do: you want to loop. > Right now, you may think that you just need to transform the elements > of a list, and MAP may work just as well as LOOP. But in a later stage > you may discover that you don't just want to transform the elements, you > also want to count them. If you'd used LOOP from the beginning, you > would > just add an extra clause. But if you'd used MAP, you would have to wrap > a > LET around it and insert an INCF inside the LAMBDA. > To some degree these things are a matter of taste so there's little point arguing about them, but I'll have a go anyway :-) One of the most important qualities code, particularly code that forms part of large software systems that will at some point be maintined by someone other than the author, is that it's easily comprehensible. Using dolist, mapc, mapcar when approriate rather than loop immediately gives someone a hand in understanding what's going on. If you see mapc you know something is being done for it's side-effects; if you see mapcar you know that the return value is important. Secondly I do believe that an essentially functional style make for more comprehsible code in any case. With things like do and loop it's (relatively) difficault to see what values are being manipulated and whether there is a return value that is being used. (Of course this may all be a self-serving justification for the fact that I haven't yet got round to learning loop in all it's glory yet :-)) -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own