all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Pierpaolo Bernardi <olopierpa@gmail.com>
Cc: dalanicolai <dalanicolai@gmail.com>,  Emacs Devel <emacs-devel@gnu.org>
Subject: Re: Weird let behavior (and where to ask for support)
Date: Sat, 22 Jan 2022 23:27:30 -0500	[thread overview]
Message-ID: <jwv8rv7cc3m.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <b37qmvo9b215lpuxvr3r4vm0.1642906267657@email.android.com> (Pierpaolo Bernardi's message of "Sun, 23 Jan 2022 03:51:07 +0100")

> You are modifying the constant '(0). Modifying constants has an unspecified
> effect, one manifestation of which you are observing.
> Change '(0) to (list 0).

Exactly.  IOW never use `nreverse`, `sort`¸ `nconc`, etc... on a list
unless you know for sure all the `conses` in that list are all freshly
made and not shared with anything else.

    '(0)

does not return a freshly made list, but instead return the same old
and tired list created when the code was loaded into Emacs.


        Stefan




  reply	other threads:[~2022-01-23  4:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-23  2:51 Weird let behavior (and where to ask for support) Pierpaolo Bernardi
2022-01-23  4:27 ` Stefan Monnier [this message]
2022-01-23 10:26   ` dalanicolai
  -- strict thread matches above, loose matches on Subject: below --
2022-01-23  0:33 dalanicolai

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv8rv7cc3m.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dalanicolai@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=olopierpa@gmail.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.