Skip to main content

Questions tagged [mutability]

Filter by
Sorted by
Tagged with
5 votes
2 answers
186 views

“A mutable object stops being mutable if it is part of an expression that is evaluated.”

GNU Emacs Lisp Reference Manual, section 2.9 Mutability: A mutable object stops being mutable if it is part of an expression that is evaluated. For example: (let* ((x (list 0.5)) (y (eval (...
shynur's user avatar
  • 5,890
2 votes
1 answer
165 views

Run an external shell command to mutate text

I would like to run par or fmt to format my .md file. In vim this would be %!fmt (for the whole buffer) or 13,16!fmt (for line 13 - line 16). What's the "emacs way" to achieve something like ...
Benjamin Philip's user avatar
3 votes
1 answer
174 views

Why is this function not pure

I just spent a significant amount of time debugging an issue that boils down to the following: (defun my-new-alist () `((x . nil))) (setq a (my-new-alist)) (setq b (my-new-alist)) (push 1 (alist-...
Clément's user avatar
  • 4,035
9 votes
2 answers
202 views

Proper reinitialization of a list? What is happening under the hood?

I'm teaching myself some more elisp and have encountered the following problem: If I want to reset a list variable it won't get updated after the first evaluation. Here is some example code: (defun ...
clemera's user avatar
  • 3,476