unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: jun  <netjune@163.com>
To: "Elias Mårtenson" <lokedhs@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re:Re: Can we add two args to copy-sequence?
Date: Fri, 15 Dec 2017 22:52:09 +0800 (CST)	[thread overview]
Message-ID: <41cc6ca4.f2de.1605aa9400f.Coremail.netjune@163.com> (raw)
In-Reply-To: <CADtN0WKT=4-RzJu8asV6HKRWmJioAerAwzi9Fpr4x7bgPNJZfw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]

Yes, I just know subseq. And there are also seq-subseq, seq-take, seq-drop, butlast, Two many and hard to remmber.
Almost all of them are implemented in lisp except copy-sequence which is in C. Some of them are implemented
by copying the whole sequence and then modify the copy. If we add the two args to copy-sequence, 
then  these functions can be based on it with only one or two lines in lisp, and reduce some data copy.
Does the two args make copy-sequence too much complex internally?




在 2017-12-15 16:24:50,"Elias Mårtenson" <lokedhs@gmail.com> 写道:

On 15 December 2017 at 15:54, John Wiegley <johnw@gnu.org> wrote:
>>>>> "j" == jun  <netjune@163.com> writes:

j> like this: (copy-sequence seq &optional from to). 'from' and 'to' mean the
j> same as in the function 'substring'.

I'd rather not overload copy-sequence that way, and rather have a new function
named (sublist LIST &optional FROM TO), even if copy-sequence xs == sublist xs.



There is already the function ‘subseq’ that does exactly this, or did I misunderstand
the question?

[-- Attachment #2: Type: text/html, Size: 1879 bytes --]

  reply	other threads:[~2017-12-15 14:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15  3:32 Can we add two args to copy-sequence? jun
2017-12-15  7:54 ` John Wiegley
2017-12-15  8:24   ` Elias Mårtenson
2017-12-15 14:52     ` jun [this message]
2017-12-16  6:18       ` John Wiegley

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41cc6ca4.f2de.1605aa9400f.Coremail.netjune@163.com \
    --to=netjune@163.com \
    --cc=emacs-devel@gnu.org \
    --cc=lokedhs@gmail.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).