Subject: bug#35710: closed (Re: bug#35710: Acknowledgement (26.1; incomplete mapconcat description string))

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 07 Jun 2019 13:03:02 +0000

Your bug report

#35710: 26.1; incomplete mapconcat description string

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
35710: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=35710
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#35710: Acknowledgement (26.1; incomplete mapconcat description string)
From: Eli Zaretskii <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Fri, 07 Jun 2019 16:02:08 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: phs <[email-masked]>
> 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.

Subject: 26.1; incomplete mapconcat description string
From: phs <[email-masked]>
To: [email-masked]
Date: Mon, 13 May 2019 10:43:48 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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"