GNU bug report logs -
#76242
[PATCH] Clarify that mapconcat's FUNCTION can return nil
Previous Next
Reported by: Hong Xu <hong <at> topbug.net>
Date: Wed, 12 Feb 2025 22:29:01 UTC
Severity: wishlist
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #30 received at 76242-done <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 13 Feb 2025 00:27:45 -0800
> From: Hong Xu <hong <at> topbug.net>
> CC: 76242 <at> debbugs.gnu.org
>
> On February 12, 2025 11:57:05 PM PST, Eli Zaretskii <eliz <at> gnu.org> wrote:
> >> Cc: hong <at> topbug.net
> >> Date: Thu, 13 Feb 2025 02:27:52 +0100
> >> From: Michael Heerdegen via "Bug reports for GNU Emacs,
> >> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> >>
> >> Hong Xu via "Bug reports for GNU Emacs, the Swiss army knife of text
> >> editors" <bug-gnu-emacs <at> gnu.org> writes:
> >>
> >> > -FUNCTION must be a function of one argument, and must return a value
> >> > - that is a sequence of characters: either a string, or a vector or
> >> > - list of numbers that are valid character codepoints. */)
> >> > + FUNCTION must be a function of one argument, and must return either:
> >> > +
> >> > + nil, which is treated as an empty string, or
> >> > + a value that is a sequence of characters, which is either a string,
> >> > + or a vector or list of numbers that are valid character codepoints. */)
> >>
> >> I don't understand the rationale. Isn't nil just one case of an empty
> >> sequence of characters? Why describe it specially?
> >
> >How about the below instead:
> >
> > FUNCTION must be a function of one argument, and must return a value
> > that is a sequence of characters: either a string, or a vector or
> > list of numbers that are valid character codepoints; nil is treated
> > as an empty string.
>
> I agree, this is better.
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Thu, 13 Feb 2025 00:29:27 -0800
> Cc: 76242 <at> debbugs.gnu.org, hong <at> topbug.net
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > How about the below instead:
> >
> > FUNCTION must be a function of one argument, and must return a value
> > that is a sequence of characters: either a string, or a vector or
> > list of numbers that are valid character codepoints; nil is treated
> > as an empty string.
>
> LGTM.
Thanks, installed on the emacs-30 release branch, and closing the bug.
This bug report was last modified 151 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.