Sujet : Re: wxPython and macros (was: Why don't people like lisp?
De : Nobody447095 (at) *nospam* here-nor-there.org (B. Pym)
Groupes : comp.lang.lispDate : 23. Jun 2025, 22:21:53
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <103cghf$1h1l0$1@dont-email.me>
User-Agent : XanaNews/1.18.1.6
Pascal Costanza wrote:
Consider the following two functions that both do the same thing:
(defun example-1 (x)
(let ((i 0))
(tagbody
:loop
(when (> i x) (go :end))
(print i)
(incf i)
(go :loop)
:end)))
(defun example-2 (x)
(loop for i from 0 to x
do (print i)))
EXAMPLE-1 requires lots of book-keeping in your head, especially when
things get messier. EXAMPLE-2 uses a for loop "just" to reduce
book-keeping and visual clutter. ;)
Why does the number being printed have to have a name?
Why not just say "Print each number"?
Gauche Scheme:
(for-each print (liota 3))
===>
0
1
2