emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature/type-hierarchy 8a63e50036f 1/5: * Define 'cl--type-hierarchy


From: Andrea Corallo
Subject: Re: feature/type-hierarchy 8a63e50036f 1/5: * Define 'cl--type-hierarchy' and compute 'cl--typeof-types' from it
Date: Sun, 03 Mar 2024 13:34:40 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

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

>>>>>> +    (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`.

Right.

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

Okay for me even if this sounds a bit arbitrary.

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

Mmmh for class and structure I thought because we have 'class-p' and
'cl-struct-p' we had the corresponding types (from which the user
defined ones are derived).  IIRC I've seen also in the past we have the
class type.

Anyway for this and the keyword thing I certainly don't have any strong
feeling/opinion, I've asked feedback on this hierarchy here since about
4 months ago really because it's tricky.  But I think it's really a good
exercise we (finally) spell it out and document it.

Thanks

  Andrea



reply via email to

[Prev in Thread] Current Thread [Next in Thread]