[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strange results
From: |
Pascal J. Bourguignon |
Subject: |
Re: Strange results |
Date: |
Sat, 07 Sep 2013 14:34:12 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
Dwaddle <rmborchers@gmail.com> writes:
> let didn't do the job, same results. But the problem is solved by explicit
> setting the value to 0 or 1
Indeed, it's not only a problem of scope (with setq you modified global
dynamic variables, which is dangerous because it _may_ interfer with
other functions using the same variables.
But your problem was because you modified a literal object originally
built by the [0 0 0 0 0 0 0 0] expression. But it is always the same
object that is modified every time you call the function. Hence the use
of vector or make-vector, which create new vectors each time they're
evaluated.
--
__Pascal Bourguignon__
http://www.informatimago.com/