From: Robert Pluim <rpluim@gmail.com>
To: emacs-devel@gnu.org
Cc: "Mattias Engdegård" <mattiase@acm.org>
Subject: Re: master d62766305a: Add `take` and `ntake` (bug#56521)
Date: Mon, 18 Jul 2022 10:48:25 +0200 [thread overview]
Message-ID: <87r12ierhi.fsf@gmail.com> (raw)
In-Reply-To: <20220717154726.F2455C00095@vcs2.savannah.gnu.org> ("Mattias Engdegård"'s message of "Sun, 17 Jul 2022 11:47:25 -0400 (EDT)")
>>>>> On Sun, 17 Jul 2022 11:47:25 -0400 (EDT), Mattias Engdegård <mattiase@acm.org> said:
Mattias> +@defun ntake n list
Mattias> +This is a version of @code{take} that works by destructively modifying
Mattias> +the list structure of the argument. That makes it faster, but the
Mattias> +original value of @var{list} is lost.
Mattias> +@end defun
Mattias> +
Mattias> @defun last list &optional n
Mattias> This function returns the last link of @var{list}. The @code{car} of
Mattias> this link is the list's last element. If @var{list} is
Mattias> null,
Does this need the usual blurb to do
(setq list-var (ntake 3 list-var))
to ensure `list-var' is updated?
Mattias> +DEFUN ("take", Ftake, Stake, 2, 2, 0,
Mattias> + doc: /* Return the first N elements of LIST.
Mattias> +If N is zero or negative, return nil.
Mattias> +If LIST is no more than N elements long, return it (or a copy). */)
Mattias> + (Lisp_Object n, Lisp_Object list)
I think this would be clearer as
"If N is >= the length of LIST, return LIST (or a copy)."
since weʼre talking about the effect of various values of N.
Mattias> +
Mattias> +DEFUN ("ntake", Fntake, Sntake, 2, 2, 0,
Mattias> + doc: /* Modify LIST to keep only the first N elements.
Mattias> +If N is zero or negative, return nil.
Mattias> +If LIST is no more than N elements long, return it. */)
And similarly here.
Robert
--
next parent reply other threads:[~2022-07-18 8:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <165807284522.13427.2673143161208860104@vcs2.savannah.gnu.org>
[not found] ` <20220717154726.F2455C00095@vcs2.savannah.gnu.org>
2022-07-18 8:48 ` Robert Pluim [this message]
2022-07-18 10:59 ` master d62766305a: Add `take` and `ntake` (bug#56521) Mattias Engdegård
2022-07-18 11:55 ` Robert Pluim
2022-07-18 16:34 ` Michael Heerdegen
2022-07-18 17:21 ` Sam Steingold
2022-07-18 18:56 ` Philip Kaludercic
2022-07-18 22:57 ` Sam Steingold
2022-07-19 10:20 ` Mattias Engdegård
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=87r12ierhi.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=mattiase@acm.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.