all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rolf Ade <rolf@pointsman.de>
To: emacs-tangents@gnu.org
Subject: Re: 2016-05-23 Emacs News
Date: Fri, 10 Jun 2016 02:04:05 +0200	[thread overview]
Message-ID: <87bn39ewp6.fsf@linux-qg7d.fritz.box> (raw)
In-Reply-To: 87lh30iv18.fsf@sachachua.com


Sacha Chua <sacha@sachachua.com> writes:
> 2016-05-23 Emacs News
>
> * Coding: 
>
>   * Literal values and destructive functions 

(That is:
http://mbork.pl/2016-05-23_Literal_values_and_destructive_functions)

Wait, what?

Sure, sort is documented as modifying the LIST in place. And the setq
makes `foo` global, so ... maybe no surprise, or so. But if I eval

(defun destructive-havoc ()
  "Example of destructive havoc."
  (let ((foo '(1 3 2)))
        (message "before sort, foo is: %s" foo)
        (sort foo #'<)
        (message "after sort, foo is: %s" foo)))

and M-: (destructive-havoc) two times, I still get

before sort, foo is: (1 3 2)
after sort, foo is: (1 2 3)
before sort, foo is: (1 2 3)
after sort, foo is: (1 2 3)

in *Messages*. Could someone please explain that to me?





  reply	other threads:[~2016-06-10  0:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 16:44 2016-05-23 Emacs News Sacha Chua
2016-06-10  0:04 ` Rolf Ade [this message]
2016-06-10 10:30   ` Nicolas Richard
2016-06-10 13:37     ` Rolf Ade
2016-06-10 13:52       ` Marcin Borkowski
2016-06-10 15:22         ` Rolf Ade
2016-06-10 16:45           ` John Mastro
2016-06-10 14:55       ` Nicolas Richard
2016-06-10 16:01         ` Rolf Ade

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=87bn39ewp6.fsf@linux-qg7d.fritz.box \
    --to=rolf@pointsman.de \
    --cc=emacs-tangents@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.
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.