GNU bug report logs - #46523
cl-struct-sequence-type documentation is incorrect

Previous Next

Package: emacs;

Reported by: Michael <sp1ff <at> pobox.com>

Date: Mon, 15 Feb 2021 04:37:01 UTC

Severity: minor

Fixed in version 28.2

Done: Lars Ingebrigtsen <larsi <at> gnus.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 46523 in the body.
You can then email your comments to 46523 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to help-debbugs <at> gnu.org:
bug#46523; Package cl-macs. (Mon, 15 Feb 2021 04:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael <sp1ff <at> pobox.com>:
New bug report received and forwarded. Copy sent to help-debbugs <at> gnu.org. (Mon, 15 Feb 2021 04:37:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael <sp1ff <at> pobox.com>
To: submit <at> debbugs.gnu.org
Subject: cl-struct-sequence-type documentation is incorrect
Date: Sun, 14 Feb 2021 19:42:36 -0800
Package: cl-macs
Version: 2.02

`cl-struct-sequence-type' states that it will "Return `record',
`vector`, or `list' if STRUCT-TYPE is a struct type, nil
otherwise." This is incorrect: it will return `vector' or `list'
if the argument was declared with those types, but if the struct
type was defaulted to `record' it will return nil. If the
argument is not a struct type the function errors.

This is due to the fact that `cl-struct-define' has the following
clause:

   (if (eq type 'record)
       ;; Defstruct using record objects.
       (setq type nil))

before `type' is passed to `cl--struct-new-class'
(cf. cl-preloaded.el).

I'm happy to submit a PR updating the docstring for
`cl-struct-sequence-type', but wanted to verify that this is the
desired behavior first (i.e. returning nil if the type is 
`record').

--
Michael <sp1ff <at> pobox.com>




bug reassigned from package 'cl-macs' to 'emacs'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 15 Feb 2021 04:38:01 GMT) Full text and rfc822 format available.

bug No longer marked as found in versions 2.02. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 15 Feb 2021 04:38:02 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 15 Feb 2021 04:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46523; Package emacs. (Sat, 25 Sep 2021 15:26:02 GMT) Full text and rfc822 format available.

Message #14 received at 46523 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Michael <sp1ff <at> pobox.com>
Cc: 46523 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#46523: cl-struct-sequence-type documentation is incorrect
Date: Sat, 25 Sep 2021 08:25:16 -0700
Michael <sp1ff <at> pobox.com> writes:

> Package: cl-macs
> Version: 2.02
>
> `cl-struct-sequence-type' states that it will "Return `record',
> `vector`, or `list' if STRUCT-TYPE is a struct type, nil
> otherwise." This is incorrect: it will return `vector' or `list'
> if the argument was declared with those types, but if the struct
> type was defaulted to `record' it will return nil. If the
> argument is not a struct type the function errors.
>
> This is due to the fact that `cl-struct-define' has the following
> clause:
>
>    (if (eq type 'record)
>        ;; Defstruct using record objects.
>        (setq type nil))
>
> before `type' is passed to `cl--struct-new-class'
> (cf. cl-preloaded.el).
>
> I'm happy to submit a PR updating the docstring for
> `cl-struct-sequence-type', but wanted to verify that this is the
> desired behavior first (i.e. returning nil if the type is `record').

Does anyone who knows more about this have an opinion here?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46523; Package emacs. (Mon, 27 Sep 2021 18:54:02 GMT) Full text and rfc822 format available.

Message #17 received at 46523 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 46523 <at> debbugs.gnu.org, Michael <sp1ff <at> pobox.com>
Subject: Re: bug#46523: cl-struct-sequence-type documentation is incorrect
Date: Mon, 27 Sep 2021 14:52:29 -0400
> Does anyone who knows more about this have an opinion here?

Returning nil sounds fine to me,


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46523; Package emacs. (Fri, 17 Jun 2022 14:49:01 GMT) Full text and rfc822 format available.

Message #20 received at 46523 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Stefan Kangas <stefan <at> marxist.se>, 46523 <at> debbugs.gnu.org,
 Michael <sp1ff <at> pobox.com>
Subject: Re: bug#46523: cl-struct-sequence-type documentation is incorrect
Date: Fri, 17 Jun 2022 16:48:27 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Does anyone who knows more about this have an opinion here?
>
> Returning nil sounds fine to me,

So I've now updated the doc string here on the emacs-28 branch.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.2, send any further explanations to 46523 <at> debbugs.gnu.org and Michael <sp1ff <at> pobox.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 17 Jun 2022 14:49:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 16 Jul 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 334 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.