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: Getting rid of cl--block-wrapper and cl--block-throw Date: Wed, 24 Jul 2024 08:46:47 -0400 Message-ID: References: <87bk2n7cyr.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="3656"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org, Stefan Monnier To: Thuna Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jul 24 14:49:03 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 1sWbQS-0000nt-5L for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Jul 2024 14:49:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWbOv-0000cN-Hn; Wed, 24 Jul 2024 08:47:25 -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 1sWbOg-0000LR-2x for emacs-devel@gnu.org; Wed, 24 Jul 2024 08:47:13 -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 1sWbOZ-00089u-AH; Wed, 24 Jul 2024 08:47:05 -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=lYjbZxsqLsMRDAhUZZ+Ne6psmoQVjV4jv5bToRDPX5M=; b=h7w01dTLJCYSl/KcPeFw PjOmgquH2zfpZw2nb55k23bu2miggdXVxS5k/SvT4qFwIWzxcNKeB1iOQD5XrLBcGs//fEM7pmGMB 5yYMNzCnVDcq3I9aWoMc1GVS/fpxsJQQcuZMLi+4VdcbpfVGcqxf3M3ZCjDIMdnvbfrtHkLJgSTyr UylPQOb9gQAIZTfDxv6Ed6jxo8vT2UHYwQb8g+bRPSlr+m4Pj3szs5m8nrAAHZCSmU//EI6qYKuHM K5JenWRe7S7HLmNnS/OjBslZGZSJXMRTAK8/X1WkJipw+ws+jjYR+YMU/DqzBXeKHWG+mlwcn82A6 Pvp7h8X3oM4AEA==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1sWbOJ-0000jo-M1; Wed, 24 Jul 2024 08:47:01 -0400 In-Reply-To: <87bk2n7cyr.fsf@gmail.com> (Thuna's message of "Wed, 24 Jul 2024 04:14:52 +0200") 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:322046 Archived-At: Thuna writes: > Is there a particular benefit to `cl-block' and `cl-return{,from}' > expanding into forms which then further expand via their compiler-macros > when what the compile-macro does can (and should) be done in the macros > themselves? Probably 414dbb000dcd62c4f252b5f73f9847340de40396 gives at least part of the explaination? * lisp/emacs-lisp/cl-macs.el (cl-byte-compile-block, cl-block-wrapper) (cl-block-throw, cl-byte-compile-throw): Use a compiler-macro rather than a `byte-compile' hook to optimize away unused CL blocks, so that also works for lexbind code. Move the code after define-compiler-macro. > I am currently doing some work in cl-*.el files (I'll post about that > soon) and part of my changes involve these macros, so I was wondering if > I was free to ditch the compiler macros or if there was a reason why > they had to be kept around. > > Part of my gripe with these compiler macros is that, AFAICT, they are > not truly optimizations but the actual expected behavior instead; they > are what ensures that the block is only established if a lexical return > exits.[1] > > Also, since I'm here I should also check - are there any significant > backwards compatibility problems associated with these macros? That is, > can I assume that no one will be left with stale `cl--block-wrapper' and > `cl--block-throw's in packages and that no code exists which depends on > cl-block's actual catch tags having predictable names? The former is > unlikely to be found in the wild, but the latter is quite likely[2], so > the actual question is about Emacs' policy in this situation. I think if anyone uses any cl--* thing outside of the cl- machinery is really at its own the risk. Ccing Stefan. Andrea