From: shin'ya TAKAMURA
Subject: Dolist
Date: 
Message-ID: <328eef$fdh@hemp.imel.kyoto-u.ac.jp>
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
========================
From: shin'ya TAKAMURA
Subject: Re: Dolist
Date: 
Message-ID: <329o68$f9r@hemp.imel.kyoto-u.ac.jp>
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
=======================