From: "Pascal J. Bourguignon" <pjb@informatimago.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Strange results
Date: Sat, 07 Sep 2013 14:34:12 +0200 [thread overview]
Message-ID: <87mwnodd4r.fsf@informatimago.com> (raw)
In-Reply-To: 6690cb5a-1739-4e69-95b0-6561c66334e2@googlegroups.com
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/
next prev parent reply other threads:[~2013-09-07 12:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-07 7:06 Strange results Dwaddle
2013-09-07 7:22 ` Erich Neuwirth
2013-09-07 7:49 ` Dwaddle
2013-09-07 7:59 ` Neuwirth Erich
2013-09-07 8:20 ` Dwaddle
2013-09-07 12:34 ` Pascal J. Bourguignon [this message]
2013-09-07 13:54 ` Neuwirth Erich
2013-11-03 0:53 ` WJ
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mwnodd4r.fsf@informatimago.com \
--to=pjb@informatimago.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).