Im a beginner of Lisp programmer. I have a question
about the "dolist".
I want to count the loop when dolisting.
(defun bb (e) (setq r 1) (dolist (x e nil) (print r)))
and
> (bb '(a a b b c))
prints 1 1 1 1 1 . How is the scope of variables?
Thanks in advance for emailing reply or following.
--+--+--+--+--+--+--+--+
Takamura Shinya
========================
in article <··········@hemp.imel.kyoto-u.ac.jp>
········@i.h.kyoto-u.ac.jp wrote:
takamura> (defun bb (e) (setq r 1) (dolist (x e nil) (print r)))
takamura>
takamura> and
takamura>
takamura> > (bb '(a a b b c))
takamura>
takamura> prints 1 1 1 1 1 . How is the scope of variables?
takamura>
I just forgot to add 1 to r. Thanks for many kind replies.
Shinya Takamura
=======================