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.bugs Subject: bug#72279: [PATCH] Non-local exits from outside the lexical scope are caught by cl-block Date: Fri, 26 Jul 2024 03:39:46 -0400 Message-ID: References: <87wmla4rqq.fsf@gmail.com> <87cyn13rxk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10477"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 72279@debbugs.gnu.org, Stefan Monnier To: Thuna Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 26 09:41:27 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 1sXFZv-0002Yy-BS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Jul 2024 09:41:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXFZQ-0003yH-BX; Fri, 26 Jul 2024 03:40:56 -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 1sXFZP-0003y8-2W for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 03:40:55 -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 1sXFZO-0008Vv-QX for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 03:40:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sXFZW-0006lk-KL for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 03:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Jul 2024 07:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72279 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72279-submit@debbugs.gnu.org id=B72279.172197960325842 (code B ref 72279); Fri, 26 Jul 2024 07:41:02 +0000 Original-Received: (at 72279) by debbugs.gnu.org; 26 Jul 2024 07:40:03 +0000 Original-Received: from localhost ([127.0.0.1]:38730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXFYY-0006ij-FD for submit@debbugs.gnu.org; Fri, 26 Jul 2024 03:40:03 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXFYW-0006hp-G1 for 72279@debbugs.gnu.org; Fri, 26 Jul 2024 03:40:01 -0400 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 1sXFYI-0008Cq-QP; Fri, 26 Jul 2024 03:39:46 -0400 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=RxnqBH2GAd0GMgfK9byo/xeO43nUtG6fDgEEd+DFBQs=; b=owXmsIWiabUpnJBpciLy oqTHEkki2t6qjRQWSFuArR9ASyR3rwPLnXjUYChUmIqyxC53y1CDkebKKwjiSrvuWa5GCnpMYVTfB yjb2hBpWWSfHME8hqiuuGepp99/he3uUX/ywVAtxAU1TPA7yS8mCOkzGNAxyyiMJ3/m1aCnizHRnR +2Axd4zCJA6D3hv+R8XYZt6wyBeuR6Uf6brmGqzzeVFHV5hQaYi2UUBAbkCij6RLsupd7OfEhfHp/ A2eOq3MkGA7Z5Gd0fwtWqUuq1my3fMxGIYJZazoRK7kvekRDp9CHZni6zpKgWldBAhPtPtEC94Wp3 aYc5EVpgkLg3kw==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1sXFYI-000885-Ib; Fri, 26 Jul 2024 03:39:46 -0400 In-Reply-To: <87cyn13rxk.fsf@gmail.com> (Thuna's message of "Fri, 26 Jul 2024 02:41:59 +0200") 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:289349 Archived-At: Thuna writes: >> BTW, for the second patch a simpler solution is to expand >> >> (cl-block A FOO) >> to >> (let ((cl--block--A ',(make-symbol "A"))) >> (catch cl--block--A FOO)) >> >> and >> >> (cl-return B FOO) >> to >> (throw cl--block--B FOO) >> >> which will signal an "unknown variable cl--block--B" if a `cl-return` is >> used outside of its block. > > Aha, yes, that would indeed be simpler. > >> But the optimization of `cl-block` when the tag is not used is >> important, so I don't think it's a good approach. > > I don't have any particular complaints against keeping this > optimization, but for the record would you be able to expand on what > exactly the problem is? It doesn't seem obvious to me that unused > `catch'es would make such a meaningful difference. Unused catches are a problem because they bloat bytecode unnecessary, also they prevent a number of optimizations in the native compiler as well. Essentially every time you have a landing pad like a catch you cannot make assumptions on where you are landing from and what's the state of your machine. It's very important we keep on removing unnecessary catches, that's why I was asking in my previous mail. Andrea