unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo <acorallo@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Mattias Engdegård" <mattias.engdegard@gmail.com>, 66615@debbugs.gnu.org
Subject: bug#66615: 30.0.50; Inconsistent 'number-or-marker' type definition in the cl- machinery
Date: Fri, 20 Oct 2023 05:05:47 -0400	[thread overview]
Message-ID: <yp1h6mlll3o.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <jwvcyxa6yip.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 19 Oct 2023 18:34:39 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I've to question now the following entry introduced in
>> `cl--typeof-types' for correctness:
>>
>> (integer number integer-or-marker number-or-marker atom)
>>
>> The doc says :
>> Each element has the form (TYPE . SUPERTYPES) where TYPE is one of
>> the symbols returned by ‘type-of’, and SUPERTYPES is the list of its
>> supertypes from the most specific to least specific.
>>
>> And indeed not every 'number' is an 'integer-or-marker'.
>
> The subtype relation doesn't derive from a tree but a DAG so the
> SUPERTYPES represents *a* linearization of the parents but just because
> `number` appears before `integer-or-marker` doesn't mean that it's
> a subtype of it.  It just means I judged that it should be considered
> "more specific".
>
> The same effect is in play for:
>
>     (null symbol list sequence atom)
>
> where clearly `symbol` is a subtype of neither `list` nor `sequence`.

Hi Stefan,

I understand now thanks, the trouble is that the hierarchy is not a tree
but a DAG and these are just single linearizations.

I think we should improve this part of the docstring as doesn't sound
complete to me.

Also shouldn't we add (null boolean symbol atom) to cover this other
path as well?

>> I suspect that's the reason why this commit introduces few failures in
>> the native-comp testsuite.
>
> If you need to know the list of supertypes of `number`, we could add
> that info explicitly, or you could "guess" it as the intersection of all
> the types that appear after `number` in `cl--typeof-types`:
>
>     (integer number integer-or-marker number-or-marker atom)
>     [...]
>     (float number number-or-marker atom)
>     [...]
>
> i.e. the intersection of (integer-or-marker number-or-marker atom)
> and (number-or-marker atom).

I think I understand how to do it, OTOH might be better to have the
hierarchy made explicit somewhere?  Still have to think to make an
opinion on this.

Thanks

  Andrea





  reply	other threads:[~2023-10-20  9:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 17:59 bug#66615: 30.0.50; Inconsistent 'number-or-marker' type definition in the cl- machinery Andrea Corallo
2023-10-18 18:30 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-19  8:56   ` Andrea Corallo
2023-10-19 12:02     ` Andrea Corallo
2023-10-19 14:22       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-19 21:24         ` Andrea Corallo
2023-10-19 22:34           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-20  9:05             ` Andrea Corallo [this message]
2023-10-20 13:45               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-20 15:42                 ` Andrea Corallo
2023-10-20 20:51                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-22  7:03                     ` Andrea Corallo

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yp1h6mlll3o.fsf@fencepost.gnu.org \
    --to=acorallo@gnu.org \
    --cc=66615@debbugs.gnu.org \
    --cc=mattias.engdegard@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).