Subject: bug#36418: closed (Re: bug#36418: 26.2.90; mapconcat "SEPARATOR must be a string." is incorrect)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 06 Jul 2019 07:34:02 +0000

Your bug report

#36418: 26.2.90; mapconcat "SEPARATOR must be a string." is incorrect

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].

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

Subject: Re: bug#36418: 26.2.90; mapconcat "SEPARATOR must be a string." is incorrect
From: Eli Zaretskii <[email-masked]>
To: Stefan Kangas <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 06 Jul 2019 10:32:51 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Stefan Kangas <[email-masked]>
> Date: Sat, 6 Jul 2019 06:17:08 +0200
> Cc: [email-masked]
> 
> > C-h S mapconcat says
> >
> >> SEPARATOR, which also must be a string, or a vector or list of
> >> characters.
> >
> > C-h f concat says
> >
> >> Each argument may be a string or a list or vector of characters (integers).
> 
> In other words, since SEPARATOR can be a "list of characters", it
> follows that it can also be nil (which is equivalent to the empty list).

Right, I fixed the doc string.

Subject: 26.2.90; mapconcat "SEPARATOR must be a string." is incorrect
From: Xu Chunyang <[email-masked]>
To: [email-masked]
Date: Fri, 28 Jun 2019 21:23:24 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

C-h f mapconcat says

> SEPARATOR must be a string.

but nil works fine

    (mapconcat #'identity '("a" "b") nil)
    ;; => "ab"

and `string-join` relies on this fact (by the way, string-join's
docstring doesn't explain the case when separator is omitted or nil)

    (defsubst string-join (strings &optional separator)
      "Join all STRINGS using SEPARATOR."
      (mapconcat 'identity strings separator))

C-h S mapconcat says

> SEPARATOR, which also must be a string, or a vector or list of
> characters.

C-h f concat says

> Each argument may be a string or a list or vector of characters (integers).