From: "Drew Adams" <drew.adams@oracle.com>
To: "'Eli Zaretskii'" <eliz@gnu.org>
Cc: 12314@debbugs.gnu.org, cyd@gnu.org
Subject: bug#12314: 24.2.50; `add-to-history': use `setq' with `delete'
Date: Sat, 8 Sep 2012 23:29:10 -0700 [thread overview]
Message-ID: <28FCC57844B14FBE8F4CD6B0B9BAE6B3@us.oracle.com> (raw)
In-Reply-To: <834nn7nbno.fsf@gnu.org>
> > The fact that modifying the list pointed to by `b' also
> > modifies the list pointed to by `a' is an advantage for
> > certain kinds of programs.
>
> I fail to see the utility of this. Building code that relies on
> internal implementation details is never a good idea. But that's me;
> please don't bother to argue.
Intentional list modification is not an implementation detail. That is, it
concerns the implementation of your program, of course, but not the
implementation of Lisp itself. You have to know what a given Lisp operation
does (side effects) and what it returns, but not how it is implemented.
My description of this area apparently did not help you.
Perhaps someone else can do better.
You might start here: (elisp) `Modifying Lists'.
You might search there for "share|sharing".
You might also google for, say, "lisp sharing list structure modification".
Looking at some of the hits, I think several should be helpful.
Here's one that might be another place to start:
http://en.wikipedia.org/wiki/Lisp_(programming_language)#Shared_structure
Perhaps you can imagine a complex program with a humongous graph structure
(already you see some sharing), which is dynamically modified. Imagine
different views (e.g., variables) into various parts of that structure. This
kind of Lisp program is not uncommon in some applications. (The same could be
done using Java or C or whatever, but Lisp is good for doing things with lists.)
Lisp is not a purely functional language. You need not like that, and you are
not forced to use `setf' etc. when programming in Lisp. But such operations are
a part of Lisp, and they are used by some Lisp programs. They are not a
mistake, but it is possible to make mistakes when using them.
next prev parent reply other threads:[~2012-09-09 6:29 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-30 23:08 bug#12314: 24.2.50; `add-to-history': use `setq' with `delete' Drew Adams
2012-09-08 14:32 ` Chong Yidong
2012-09-08 14:43 ` Eli Zaretskii
2012-09-08 14:57 ` Drew Adams
2012-09-08 15:20 ` Eli Zaretskii
2012-09-08 15:48 ` Drew Adams
2012-09-08 16:05 ` Eli Zaretskii
2012-09-08 16:19 ` Andreas Schwab
2012-09-08 16:33 ` Eli Zaretskii
2012-09-08 16:50 ` Lars Ingebrigtsen
2012-09-08 16:54 ` Drew Adams
2012-09-08 17:06 ` Andreas Schwab
2012-09-08 16:35 ` Drew Adams
2012-09-08 16:25 ` Drew Adams
2012-09-08 16:32 ` Eli Zaretskii
2012-09-08 16:42 ` Drew Adams
2012-09-08 21:21 ` Eli Zaretskii
2012-09-08 22:26 ` Drew Adams
2012-09-09 3:00 ` Eli Zaretskii
2012-09-09 6:29 ` Drew Adams [this message]
2012-09-09 7:53 ` Chong Yidong
2012-09-09 17:25 ` Eli Zaretskii
2012-09-10 11:54 ` Wolfgang Jenkner
2012-09-08 23:11 ` Stefan Monnier
2012-09-09 2:51 ` Eli Zaretskii
2012-09-09 14:44 ` Stefan Monnier
2012-09-09 17:14 ` Eli Zaretskii
2012-09-09 17:35 ` Drew Adams
2012-09-09 18:20 ` Eli Zaretskii
2012-09-09 19:46 ` Drew Adams
2012-09-09 21:37 ` Stefan Monnier
2012-09-10 4:37 ` Eli Zaretskii
2012-09-10 12:59 ` Stefan Monnier
2012-09-10 15:01 ` Stefan Monnier
2012-09-10 15:21 ` Drew Adams
2012-09-10 16:24 ` Eli Zaretskii
2012-09-09 8:25 ` Dmitry Gutov
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=28FCC57844B14FBE8F4CD6B0B9BAE6B3@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=12314@debbugs.gnu.org \
--cc=cyd@gnu.org \
--cc=eliz@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.