Re: A style question



In article <1172658813.746823.247380@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"Tim Bradshaw" <tfb+google@xxxxxxxx> wrote:

On Feb 28, 2:02 am, job-271842...@xxxxxxxxxxxxxx wrote:


1) In "ANSI Common Lisp", Graham makes the following comments:
"The loop macro was originally designed to help inexperienced Lisp
users write iterative code...Unfortunately, loop is more like English
than its designers ever intended...to understand it in the abstract is
almost impossible...For such reasons, the use of loop cannot be
recommended."

Reading Paul Graham is a bit like reading reviews of films by a good
critic: he is almost always wrong about everything, but has
interesting things to say and it's possible to reliably predict
whether you'll like something from what he says about it (though often
you will differ from him on whether you like it, due to the above-
mentioned almost-always-being-wrong thing). He's kind of the Barry
Norman of Lisp, really.

I agree. ;-)



Is this a minority view? One of the things that attracted me to Lisp
was the simplicity, consistency, etc. of the language, so when I read
the above, it seemed reasonable.

Simplicity? consistency? I think you're thinking of some other
language there. CL is this vast industrial thing full of enormous
machines, oil and rust. Some compartments are full of water, and no
one knows what some of the machines do, if anything. Many parts of it
use a mixture of Whitworth & BSF threads (some left-handed), though
much has now been converted to BA or metric, sometimes by use of taps
& dies, sometimes with a hammer.

CL's closest living relative is FORTRAN: always remember that.

Common Lisp is a bit of the alligator in the pond, eating all
the younger designs. ;-)

Incidentally, I'm deeply disappointed in the quality of answers in
this thread. In the elder days there would have been at least a few
followups showing how to do this in the proper "FORMAT string
indistinguishable from line noise" way. No true CL programmer ever
uses any other construct when the problem can be solved with a
combination of FORMAT, LOOP & GO (FORMAT being always preferable,
obviously). There may yet be those reading cll who know this, though
I suspect they have all gone into the west now.

It is always a shock to me when I look at such code. I mean
many pages long functions full of GOs, two letter variables
and such (and zero comments). I cannot
believe that humans can write this code. I always
think the author was some ugly 'Terminator' from the future,
though lately the Terminators seem to be blond and good looking.


--tim (who has used the FORMAT string mentioned in
http://www.tfeb.org/lisp/obscurities.html in anger)
.



Relevant Pages

  • Re: A style question
    ... "The loop macro was originally designed to help inexperienced Lisp ... than its designers ever intended...to understand it in the abstract is ... I started playing with it, but I am just an elder, not a Lisp elder. ...
    (comp.lang.lisp)
  • Re: A style question
    ... "The loop macro was originally designed to help inexperienced Lisp ... than its designers ever intended...to understand it in the abstract is ... followups showing how to do this in the proper "FORMAT string ...
    (comp.lang.lisp)
  • How to Speed up Cellular Automata [was Re: How to speed up an OpenGL application?]
    ... In the loop you hit aref a dozen times, god knows what else, without an iota of optimization. ... Lisp does more by default, so if you need to write ... (if (zerop cell) ...
    (comp.lang.lisp)
  • Re: Very poor Lisp performance
    ... Observe LOOP, ... than many Lisp users, as LOOP is offensive to a percentage of Lisp ... >>> natural and programming languages have complicated grammars precisely ... do you agree that languages are evolving to be more concise? ...
    (comp.lang.lisp)
  • efficiently accumulating values
    ... do (loop as j from 0 to (1- n) ... do (let ((old (aref matrix i j))) ... acc (rec ni nj word acc) ... Is there an efficient way to accumulate values in lisp? ...
    (comp.lang.lisp)