[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: replacing a certain element in a list with another
From: |
Stefan Monnier |
Subject: |
Re: replacing a certain element in a list with another |
Date: |
Tue, 30 Sep 2003 15:47:01 GMT |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
> Well, it depends on whether the OP wants to return a new list or to modify
> the original list.
That's exactly what was meant by "have good reasons to do it". Mixing the
in-place-update style with the create-new-stuff style (aka imperative style
vs functional style) is a common source of error because it generally makes
the code more "subtle" (more difficult to understand). Since elisp usually
copies things around, inplace-update operations such as nconc, nreverse,
setcar, setcdr, delete, delq, ... should be used with caution.
Stefan
- Re: replacing a certain element in a list with another, (continued)
Re: replacing a certain element in a list with another, Stefan Monnier, 2003/09/30