help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Plist-put changes literal argument


From: Yuan Fu
Subject: Plist-put changes literal argument
Date: Wed, 2 Sep 2020 19:55:25 -0400

I found plist-put changes the literal argument I pass to a function:

(defun test ()
  (test-2 '(:a b)))

(defun test-2 (form)
  (print form)
  (plist-put form :a 'c)
  nil)

(progn (test) (test))

(:a b)

(:a c)
nil

I thought Elisp is pass-by-copy? Is this expected?

P.S., (setf (alist-get )) does the same, I guess this IS expected?

Yuan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]