From: Drew Adams <drew.adams@oracle.com>
To: Stefan Kangas <stefan@marxist.se>
Cc: 42324@debbugs.gnu.org
Subject: bug#42324: 26.3; Doc string of `seq-concatenate'
Date: Tue, 25 Aug 2020 15:46:59 -0700 (PDT) [thread overview]
Message-ID: <f5df3cc5-3fad-4295-9f67-e2359317832a@default> (raw)
In-Reply-To: <CADwFkmma0jyd8P0CNqXp80KghqSqkdFS_fHsMm3v2cXMKmEEqw@mail.gmail.com>
> > 1. See bug #42323 for the problem of the unhelpful, implicit reference
> > to CL implementations and "generic function".
>
> Do we need two bugs to track that? It looks to me like essentially the
> same issue.
Point #1 is common to both bugs, i.e., it's a problem
for both doc strings. But #1 is not the only problem
for `seq-concatenate'. If you fix #1 in a general way,
so it is fixed for both doc strings (and hopefully
others), then you can close #42323. But if only #1 is
fixed then #42324 isn't fixed.
That's why there are 2 bug reports. I don't know how
#1 will be fixed, e.g. whether it will be fixed for
only this or that doc string or all relevant doc strings.
> > 2. The doc of `seq-concatenate' _really_ needs a description of how it
> > differs from `cl-concatenate'. That's completely unclear.
>
> On current master I see:
>
> cl-concatenate is an alias for ‘seq-concatenate’ in ‘cl-extra.el’.
I see. That's not the case in the Emacs version of the
bug report.
Is that correct? Does `seq-concatenate' correctly
implement Common Lisp `concatenate'? If so, then the
alias is good. If not, then `cl-concatenate' needs
to be fixed to correctly fit the bill.
> > 3. The doc says nothing about each SEQUENCE actually being automatically
> > converted (by copying, presumably) into a real sequence:
> > `seq-into-sequence'. It's not clear what's allowed as SEQUENCE.
>
> I'm not sure I understand this.
In Emacs 26.3, this is the definition of `seq-concatenate':
(cl-defgeneric seq-concatenate (type &rest sequences)
"Concatenate SEQUENCES into a single sequence of type TYPE.
TYPE must be one of following symbols: vector, string or list.
\n(fn TYPE SEQUENCE...)"
(apply #'cl-concatenate
type
(seq-map #'seq-into-sequence sequences)))
First, in this Emacs version clearly `cl-concatenate' can't
be the same as `seq-concatenate'.
Second, `seq-into-sequence' seems like a really bad name,
for something that either raises an error or is `identity'.
The name suggests that something that is not quite a sequence
gets converted into a sequence. I was misled by the name,
I guess.
Well, maybe not. Apparently `cl-defgeneric' just defines
_default_ behavior. So the point remains: the doc string
should say that the SEQUENCES are first converted into
proper sequences (in some way), which are then passed to
`cl-concatenate'. And it should probably state the
default behavior of just raising an error if not already
a sequence.
I'd say, overall, that I don't understand the behavior
by reading the doc string. And we should. We shouldn't
have to guess that `cl-defgeneric' is used, and so the
behavior might actually be this, that, or the other
thing (or whatever the case may be). The do string
should say what the behavior is, including what it _can
be_, if `cl-defgeneric' allows it to end up differing,
depending on SEQUENCES.
> > #2 is the main reason I filed this bug report. What's the difference?
> > Why/when would you use one rather than the other?
next prev parent reply other threads:[~2020-08-25 22:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-11 16:10 bug#42324: 26.3; Doc string of `seq-concatenate' Drew Adams
2020-08-25 22:24 ` Stefan Kangas
2020-08-25 22:46 ` Drew Adams [this message]
2020-08-26 6:00 ` Eli Zaretskii
[not found] <<efa23108-da23-4a5b-8bd7-23f25007bed0@default>
[not found] ` <<CADwFkmma0jyd8P0CNqXp80KghqSqkdFS_fHsMm3v2cXMKmEEqw@mail.gmail.com>
[not found] ` <<f5df3cc5-3fad-4295-9f67-e2359317832a@default>
[not found] ` <<83a6yi3q0p.fsf@gnu.org>
2020-08-26 18:14 ` Drew Adams
2020-08-26 18:30 ` Eli Zaretskii
[not found] <<<efa23108-da23-4a5b-8bd7-23f25007bed0@default>
[not found] ` <<<CADwFkmma0jyd8P0CNqXp80KghqSqkdFS_fHsMm3v2cXMKmEEqw@mail.gmail.com>
[not found] ` <<<f5df3cc5-3fad-4295-9f67-e2359317832a@default>
[not found] ` <<<83a6yi3q0p.fsf@gnu.org>
[not found] ` <<a12959b1-2625-49b8-82df-004a3f6afaa4@default>
[not found] ` <<83mu2h2rah.fsf@gnu.org>
2020-08-26 18:37 ` Drew Adams
2020-08-26 18:57 ` Eli Zaretskii
2020-08-27 14:27 ` Lars Ingebrigtsen
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=f5df3cc5-3fad-4295-9f67-e2359317832a@default \
--to=drew.adams@oracle.com \
--cc=42324@debbugs.gnu.org \
--cc=stefan@marxist.se \
/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.