Kelly Murray (kem@franz.com) wrote:
<snip>
: (let ((x 10) (y 20))
: (do ((i 0 (+ i 1)))
: ((> i 10) x)
: (cond ((> x y) 10)
: ((< x 0) 20))))
: When it is much clearer and accessible if it is written like this:
: (let x = 10
: y = 20
: do
: (loop for i from 1 to 10
: do
: (if (> x y)
: then
: 10
: elseif (< x 0)
: then
: 20
: else
: nil)
I think that I just might be in my "Lisp mindset"--a mindset
necessitated by a class in AI which I am taking at the moment,
which requires that I write large amounts of Lisp code every
week.[1] In any case, _at this particular moment in time_, the
top version, with all the nasty parentheses, I find easier
to read and more understandable than the bottom version, with
all these silly, unnecessary little words everywhere, that
take up valuable keystrokes and lines. Anyway. After the
class is over and I'm back to C and C++ all the time, Version
B will begin to look better than Version A.
Cheers,
-et
[1] Aside: as an experiment I tried rewriting one of my Lisp
examples into Java, just to see how long it would take. It took
perhaps twice as long--not so good as Lisp with respect to
speed of coding, but pretty good.
--
Ernest S. Tomlinson | "For every Government consists of mere men and is,
etomlins@rohan.sdsu.edu | strictly viewed, a makeshift; if it adds to its
------------------------+ commands 'Thus saith the Lord', it lies, and lies
dangerously." - C. S. Lewis
|