GNU bug report logs -
#35710
26.1; incomplete mapconcat description string
Previous Next
Reported by: phs <at> lsv.fr
Date: Mon, 13 May 2019 09:00:02 UTC
Severity: wishlist
Found in version 26.1
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35710 in the body.
You can then email your comments to 35710 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35710
; Package
emacs
.
(Mon, 13 May 2019 09:00:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
phs <at> lsv.fr
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 13 May 2019 09:00:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
In my v26.1, the description string for mapconcat is
mapconcat is a built-in function in ‘src/fns.c’.
(mapconcat FUNCTION SEQUENCE SEPARATOR)
Apply FUNCTION to each element of SEQUENCE, and concat the results as
strings.
In between each pair of results, stick in SEPARATOR. Thus, " " as
SEPARATOR results in spaces between the values returned by FUNCTION.
SEQUENCE may be a list, a vector, a bool-vector, or a string.
The description does not say what is accepted for SEPARATOR, it only
gives an example.
By playing around a bit, it turns out that SEPARATOR can be a string
(obviously), a list of chars, a vector of chars, the empty bool-vector
but not any other bool-vector.
It is not clear why these possibilities are offered while some are not
(e.g., why not make SEPARATOR optional?). This is one more reason to
make the description string explicit about what is allowed.
--
Philippe SCHNOEBELEN,
"Algebraic symbols are used when you do not know what you are talking about"
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35710
; Package
emacs
.
(Mon, 13 May 2019 12:03:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 35710 <at> debbugs.gnu.org (full text, mbox):
phs <phs <at> lsv.fr> writes:
> In my v26.1, the description string for mapconcat is
>
> mapconcat is a built-in function in ‘src/fns.c’.
>
> (mapconcat FUNCTION SEQUENCE SEPARATOR)
>
> Apply FUNCTION to each element of SEQUENCE, and concat the results as
> strings.
> In between each pair of results, stick in SEPARATOR. Thus, " " as
> SEPARATOR results in spaces between the values returned by FUNCTION.
> SEQUENCE may be a list, a vector, a bool-vector, or a string.
>
> The description does not say what is accepted for SEPARATOR, it only
> gives an example.
It mentions concat, which is what determines what is acceptable. I
agree it could be made more explicit though.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35710
; Package
emacs
.
(Mon, 13 May 2019 14:16:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 35710 <at> debbugs.gnu.org (full text, mbox):
> From: Noam Postavsky <npostavs <at> gmail.com>
> Date: Mon, 13 May 2019 08:02:44 -0400
> Cc: 35710 <at> debbugs.gnu.org
>
> > (mapconcat FUNCTION SEQUENCE SEPARATOR)
> >
> > Apply FUNCTION to each element of SEQUENCE, and concat the results as
> > strings.
> > In between each pair of results, stick in SEPARATOR. Thus, " " as
> > SEPARATOR results in spaces between the values returned by FUNCTION.
> > SEQUENCE may be a list, a vector, a bool-vector, or a string.
> >
> > The description does not say what is accepted for SEPARATOR, it only
> > gives an example.
>
> It mentions concat, which is what determines what is acceptable. I
> agree it could be made more explicit though.
The manual does spell that out, we could simply add that to the doc
string.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35710
; Package
emacs
.
(Tue, 14 May 2019 08:15:03 GMT)
Full text and
rfc822 format available.
Message #14 received at 35710 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Thanks for the explanations, I never realized that concat was so
versatile (and I'm an emacs lover since 1983). Live and learn ...
Here is a suggested replacement for the documentation string (patch
attached). It produces
Apply FUNCTION to each element of SEQUENCE, and concat the results as
strings.
In between each pair of results, stick in SEPARATOR. Thus, " " as
SEPARATOR results in spaces between the values returned by FUNCTION.
SEQUENCE may be a list, a vector, etc. see ‘mapcar’.
SEPARATOR and all values returned by FUNCTION must be accepted by ‘concat’.
--phs
[mapconcat-descr.patch (text/plain, attachment)]
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Fri, 07 Jun 2019 13:03:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
phs <at> lsv.fr
:
bug acknowledged by developer.
(Fri, 07 Jun 2019 13:03:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 35710-done <at> debbugs.gnu.org (full text, mbox):
> From: phs <phs <at> lsv.fr>
> Date: Tue, 14 May 2019 10:14:02 +0200
>
> Thanks for the explanations, I never realized that concat was so
> versatile (and I'm an emacs lover since 1983). Live and learn ...
>
> Here is a suggested replacement for the documentation string (patch
> attached). It produces
>
> Apply FUNCTION to each element of SEQUENCE, and concat the results as
> strings.
> In between each pair of results, stick in SEPARATOR. Thus, " " as
> SEPARATOR results in spaces between the values returned by FUNCTION.
> SEQUENCE may be a list, a vector, etc. see ‘mapcar’.
> SEPARATOR and all values returned by FUNCTION must be accepted by ‘concat’.
Thanks, I fixed the doc string in a slightly different way. The fix
will be in Emacs 26.3. I'm therefore marking this bug done.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 06 Jul 2019 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 289 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.