all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Andrea Corallo <acorallo@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: feature/type-hierarchy 8a63e50036f 1/5: * Define 'cl--type-hierarchy' and compute 'cl--typeof-types' from it
Date: Sun, 03 Mar 2024 09:21:41 -0500	[thread overview]
Message-ID: <jwvmsrfe7rq.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <yp1ttln1yvz.fsf@fencepost.gnu.org> (Andrea Corallo's message of "Sun, 03 Mar 2024 03:51:44 -0500")

>>>>> +    (symbol-with-pos keyword))
>>> Can't we have keyword that is a symbol-with-pos as well?
>> I'm not sure (it depends if we agree that a `symbol-with-pos` is also
>> a `symbol`.   In practice it presumably depends on the value of
>> `symbols-with-pos-enabled` 🙁),
> I *think* (thought at this point?) symbols-with-pos are symbols 🤷.

`symbolp` on a sympos will return t or nil depending on
`symbols-with-pos-enabled`, and similarly functions that accept symbols
will usually accept sympos only if that variable is set :-(

>> but I know that not all `symbol-with-pos`s are `keyword`s.
> How do you think this should be expressed in the DAG?
> I thought this was the correct way but I can indeed be wrong.

It's clearly not right, because a subtype means set-inclusion, which
here means that the current table asserts that all keywords are also
`symbol-with-pos`.

AFAIK `symbol-with-pos` just doesn't have any subtypes.  We could
introduce a new type `keyword-with-pos`, which would be a subtype of
`symbol-with-pos` and `keyword`, but I don't see much need for it.

Our DAG is "incomplete" in the sense that some values don't have a "most
specific type".  "keyword with pos" is indeed such a case.  A list of
the form (lambda ...) is another such case,

While I'm here, I also notice you added `class` and `structure` in
there, but I don't think these can be currently considered as "types"
(or at least, I don't know how they would be defined).

Of course, there are more quirks, like the `subrp` which returns t for
special forms, which aren't functions (that's a FIXME you threw away
when you replaced `cl--typeof-types` with `cl--type-hierarchy`).

> Could you explain why you think `symbols-with-pos-enabled` should
> influence our type hierarchy?

AFAIK types are defined by the set of values they can hold and/or by the
set of operations we can apply to those values.  And the set of
operations we can apply on sympos depends on this variable :-(


        Stefan




  reply	other threads:[~2024-03-03 14:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <170801660982.26727.13226947668211497607@vcs2.savannah.gnu.org>
     [not found] ` <20240215170330.82819C0F009@vcs2.savannah.gnu.org>
2024-03-01 16:49   ` feature/type-hierarchy 8a63e50036f 1/5: * Define 'cl--type-hierarchy' and compute 'cl--typeof-types' from it Stefan Monnier
2024-03-01 18:12     ` Andrea Corallo
2024-03-01 18:59       ` Stefan Monnier
2024-03-03  8:51         ` Andrea Corallo
2024-03-03 14:21           ` Stefan Monnier [this message]
2024-03-03 18:34             ` Andrea Corallo
2024-03-03 20:41               ` Stefan Monnier
2024-03-04  9:16                 ` Andrea Corallo
2024-03-04 15:37                   ` Stefan Monnier
2024-03-04 16:12                     ` Andrea Corallo
2024-03-04 16:35                       ` Stefan Monnier
2024-03-03 16:56     ` Andrea Corallo
2024-03-03 17:31       ` Stefan Monnier
2024-03-03 18:05         ` Andrea Corallo
2024-03-03 18:20           ` Stefan Monnier
2024-03-03 18:37             ` Andrea Corallo
2024-03-03 20:42               ` Stefan Monnier
2024-03-04  9:24                 ` Andrea Corallo
2024-03-04 15:51                   ` Stefan Monnier

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=jwvmsrfe7rq.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=acorallo@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.