Subject: Re: bug#77725: 31.0.50; Add support for types accepted by `cl-typep' to cl-generic?

From: Stefan Monnier <[email-masked]>
Date: Fri, 25 Apr 2025 15:37:38 -0400

[ Just tooting my horn, nothing to see.  ]

>> Here is a test case with a recursion:
>>
>> (cl-deftype T1 ()
>>   "Root type.
>> Check if passed object is a subtype of T1. I.e., if T1 is present in
>> object type parents."
>>   `(satisfies ,(lambda (o) (memq 'T1 (gtype-of o)))))
>
> Hmm... I can see that it could be handy if you don't know how to
> characterize type T1 other than as the "sum" of its subtypes.
> But this seems rather circular.  Have you seen such things out in
> the wild?

BTW, this form of circularity is called an *impredicative* definition:
the above definition does not directly refer to T1 (as in the case of
a recursive definition), instead it refers (via the definition of
`gtypes-of`) to the set of all types, to which T1 happens to belong.

As it happens, the notion of *type* was invented/introduced by Bertrand
Russel (early 20th century) specifically in order to try and disallow
the kind of paradoxes (like Russel's paradox or the paradox of the
barber) that impredicativity makes possible.

OK, you can go back to your regularly scheduled ELisp hacking now,

        Stefan