From: tsugutomo.enami@jp.sony.com
To: Drew Adams <drew.adams@oracle.com>
Cc: 18253@debbugs.gnu.org
Subject: bug#18253: 24.4.50; doc string of `remq': correct it per the doc of `remove'
Date: Thu, 28 Aug 2014 08:49:13 +0900 [thread overview]
Message-ID: <tkr1ts1o5mu.fsf@sigxcpu.sm.sony.co.jp> (raw)
In-Reply-To: <537440a2-c7e9-4a65-81e4-7cc7e9a18f97@default>
Hi,
I guess the specification of Emacs's remove/remq should be clarified
first.
If current implementaion is correctly reflecting the specification, then
I hope it is documented that those function might not return a copy on
some case (in other words, document which can be read as if they always
return a copy is confusing).
If current implementaion is not correct, then they should be fixed (and
documentation is updated to reflect the specification, if necessary).
> > The point of remq/remove is non-destructive operation. Whether it
> > returns a copy or not is not important. This matches CL's `remove'
> > definition.
>
> No, it does not. From CLTL, section 14.3, "Modifying Sequences":
>
> The result is a sequence of the same kind as the argument SEQUENCE
> that has the same elements except that those in the subsequence
> delimited by :start and :end and satisfying the test (see above)
> have been removed. This is a non-destructive operation; the result
> is a copy of the input SEQUENCE, save that some elements are not
> ^^^^^^^^^
> copied. Elements not removed occur in the same order in the result
> ^^^^^^
> that they did in the argument.
>
> That text was in the original edition of CTLT (1984), and it has not
> changed one bit in subsequent revisions.
Probably, I failed to pick up my word. What I meant was that those
function might not return a copy and they doesn't modify its argument is
more important aspect. Of course it is importatnt to copy cells when
necessary.
The `remove' might not return a copy is described in the last sentense
of the section (quoted from
https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node144.html):
The result of remove may share with the argument sequence; a list
result may share a tail with an input list, and the result may be eq
to the input sequence if no elements need to be removed.
enami.
prev parent reply other threads:[~2014-08-27 23:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-12 14:59 bug#18253: 24.4.50; doc string of `remq': correct it per the doc of `remove' Drew Adams
2014-08-25 3:19 ` Christoph
2014-08-25 22:12 ` tsugutomo.enami
2014-08-25 22:37 ` Drew Adams
2014-08-26 18:34 ` Stefan Monnier
2014-08-26 18:57 ` Drew Adams
2014-08-27 3:18 ` Stefan Monnier
2014-08-27 4:55 ` Drew Adams
2014-08-27 5:31 ` tsugutomo.enami
2014-08-27 14:06 ` Drew Adams
2014-08-27 23:49 ` tsugutomo.enami [this message]
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=tkr1ts1o5mu.fsf@sigxcpu.sm.sony.co.jp \
--to=tsugutomo.enami@jp.sony.com \
--cc=18253@debbugs.gnu.org \
--cc=drew.adams@oracle.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.
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.