From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel 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 Message-ID: References: <170801660982.26727.13226947668211497607@vcs2.savannah.gnu.org> <20240215170330.82819C0F009@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1051"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 03 19:35:46 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rgqga-000AWK-Ou for ged-emacs-devel@m.gmane-mx.org; Sun, 03 Mar 2024 19:35:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgqfc-0006Of-CB; Sun, 03 Mar 2024 13:34:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rgqfZ-0006O9-9W for emacs-devel@gnu.org; Sun, 03 Mar 2024 13:34:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rgqfY-0000Ek-BL; Sun, 03 Mar 2024 13:34:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=FsJVvuVD7H6OV12ylvMhB6qBbK1hZ1XPe12W3TyfJOw=; b=l2dw1SLJ6RlvIShqpdRx sw2xhkZ0cdEFq2PjABJPdOuVN0urDy1bSXT2/UtEsNvL4ZfXQIvXndXFmPTV3EkEhn5QIvvVv1kPw ZN2VLSPLgxyY19GQP+Dpz1tjKb3l7tlSr7n3E/WjymXyAny5u9h2lEHkMcjgp/RMoxG0rd6pfDrxG OHyfWqi+bbMre+Qrl8VWXiUp1gXhGaj3sfwKnWH+Yx4TA2E6jUi6pJzHkZl/O2Cu6dQQRk5C5PgpX C/cxdIliWF920aGeh7BAqU2aZYN9J5Mc/sxaVUwQ7Gtts2/F/x/kI52xr0PTMHRqa3Tzjszk9QxR6 fD71j1fVYLm3EQ==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rgqfY-0006I4-54; Sun, 03 Mar 2024 13:34:40 -0500 In-Reply-To: (Stefan Monnier's message of "Sun, 03 Mar 2024 09:21:41 -0500") X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316767 Archived-At: Stefan Monnier 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` =F0=9F=99=81), >> I *think* (thought at this point?) symbols-with-pos are symbols =F0=9F= =A4=B7. > > `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