emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:Re: Can we add two args to copy-sequence?


From: jun
Subject: Re:Re: Can we add two args to copy-sequence?
Date: Fri, 15 Dec 2017 22:52:09 +0800 (CST)

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" <address@hidden> 写道:
On 15 December 2017 at 15:54, John Wiegley <address@hidden> wrote:
>>>>> "j" == jun  <address@hidden> 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?


 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]