From: Yuan Fu <casouri@gmail.com>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Plist-put changes literal argument
Date: Sun, 6 Sep 2020 11:23:56 -0400 [thread overview]
Message-ID: <F9FE20E0-3844-42C8-9450-CE06BA9DD4A9@gmail.com> (raw)
In-Reply-To: <CAArVCkSzpugdW_cv6TXTu6NbNk+k86NGgKk1AFOp5ieONaOPAg@mail.gmail.com>
> On Sep 5, 2020, at 11:55 AM, Philipp Stephani <p.stephani2@gmail.com> wrote:
>
> Am Do., 3. Sept. 2020 um 02:18 Uhr schrieb Yuan Fu <casouri@gmail.com <mailto:casouri@gmail.com>>:
>>
>>>
>>> I also tried setcar, same result. So Elisp doesn’t copy arguments?
>>>
>>> Yuan
>>
>>
>> Ok, think more of it, it would be weird to make a full copy of cons (and other non-primitive values) on function call. I wonder how do other languages deal with this, because I never run into problems like this (except for in Python, with its default argument values).
>
> Most other languages don't have literals of mutable types; or, if they
> do, they create a new object for each evaluation of the literal
> expression.
I see, that explains it. Thanks!
Yuan
next prev parent reply other threads:[~2020-09-06 15:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-02 23:55 Plist-put changes literal argument Yuan Fu
2020-09-02 23:59 ` Yuan Fu
2020-09-03 0:18 ` Yuan Fu
2020-09-03 0:53 ` Noam Postavsky
2020-09-05 15:55 ` Philipp Stephani
2020-09-06 15:23 ` Yuan Fu [this message]
2020-09-05 15:53 ` Philipp Stephani
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=F9FE20E0-3844-42C8-9450-CE06BA9DD4A9@gmail.com \
--to=casouri@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=p.stephani2@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.
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).