From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69739: 30.0.50; `type-of` is not precise enough Date: Fri, 15 Mar 2024 10:09:11 -0400 Message-ID: References: <86o7bjtuvj.fsf@gnu.org> <86il1rtrvm.fsf@gnu.org> <86a5n2tkga.fsf@gnu.org> <877ci3stzu.fsf@epfl.ch> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24403"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 69739@debbugs.gnu.org To: "Basil L. Contovounesios" , Andrea Corallo , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 15 15:09:54 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rl8Ft-00066C-5a for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Mar 2024 15:09:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rl8FX-0000h6-Rh; Fri, 15 Mar 2024 10:09:32 -0400 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 1rl8FT-0000em-32 for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 10:09:28 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rl8FS-0004Hg-Qy for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 10:09:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rl8G2-0002HJ-Re for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 10:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Mar 2024 14:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69739 X-GNU-PR-Package: emacs Original-Received: via spool by 69739-submit@debbugs.gnu.org id=B69739.17105118018746 (code B ref 69739); Fri, 15 Mar 2024 14:10:02 +0000 Original-Received: (at 69739) by debbugs.gnu.org; 15 Mar 2024 14:10:01 +0000 Original-Received: from localhost ([127.0.0.1]:53544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rl8G0-0002H0-Tf for submit@debbugs.gnu.org; Fri, 15 Mar 2024 10:10:01 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:45307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rl8Fw-0002Gl-Tr for 69739@debbugs.gnu.org; Fri, 15 Mar 2024 10:10:00 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C8D4180E77; Fri, 15 Mar 2024 10:09:14 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1710511753; bh=nseZhX9PyL73HwOF12SIhTAtRn4H9Amc9arkcFT4BUw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=SZooPtF+QVw0v3NTsT0dlzm+EwuN/lSNw67F8UCNJfwjrfDF0Dqior6/16QhvpoYn zt2aIVAa3tgfwH5Q6f58tjVyC3fSUsnqWr3oPqxN+TuFSXKJzMygLgLzsnXrf2vfnZ cRBJ5uHSsQkdALKvHKtHfpJ+Dfi0z76is4B6KrhYRrdOpA3NkjqgDWjDzYbpK1pE7z ieE1CfdrqHoSyWqj9I10O73uJbdapJLIQgeCss8TKj3OaFSYQUkXKT5qc8hyfWYxLc dJAOcoHCVUwBCuY0kmSrug+S/3PxONAldpjI6QObCjUVuCl3rYm7odZ5XmquWGOmj8 tyAiU5ubNtTBQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5D13580CD7; Fri, 15 Mar 2024 10:09:13 -0400 (EDT) Original-Received: from pastel (unknown [216.154.27.181]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 30290120306; Fri, 15 Mar 2024 10:09:13 -0400 (EDT) In-Reply-To: <877ci3stzu.fsf@epfl.ch> (Basil L. Contovounesios's message of "Fri, 15 Mar 2024 10:51:33 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281680 Archived-At: Basil L. Contovounesios [2024-03-15 10:51:33] wrote: > No objections here, just one question: did you consider extending > type-of with an optional argument instead of introducing cl-type-of? > Or would that be too messy? I did. I decided to introduce a new function for the following reasons: - The main use for the new function is in the dispatch code of `cl-generic` where it's on the critical path, so one less argument is better than one more argument. Not sure how much impact it would really have, tho, so it's not a very strong argument. - I don't know of a good reason to prefer the `type-of` behavior other than backward compatibility, and requiring a non-nil arg to get the "good" behavior would make it difficult to get rid of the legacy behavior. Andrea Corallo [2024-03-15 06:54:36] wrote: > FWIW: I think this is a good change and agree `cl-type-of` is a good > name for the new function. I'm just wondering if we should have some > test to cover this. Are you suggesting that my code can be anything else than perfect? More seriously, I couldn't think of a good test, but I'll try harder. Eli Zaretskii [2024-03-15 13:50:56] wrote: > Should we document this new function in the ELisp manual? I was thinking that we should do that only when/if we demote `type-of` (`(cl-)type-of` is an operation that's used very rarely, so I think it's best to keep it to a minimum in the manual), Of course, the name also begs the question whether it should be in the ELisp manual or in the CL manual. In a previous version of the patch I had it documented alongside `type-of`, so I can easily dig that up if you think it's best. Stefan