From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Some improvements for cl-flet Date: Sun, 26 Sep 2021 08:54:06 +0200 Message-ID: <87czovsu7l.fsf@gnus.org> References: <87bl4zqnqn.fsf@gmail.com> <87mto2gbpu.fsf@gmail.com> <87k0j6gbjg.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="14630"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: akater Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 26 08:55:29 2021 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 1mUO4N-0003ZP-Gy for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Sep 2021 08:55:27 +0200 Original-Received: from localhost ([::1]:44194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUO4M-0007Nc-Ix for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Sep 2021 02:55:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUO3E-0006ZE-67 for emacs-devel@gnu.org; Sun, 26 Sep 2021 02:54:16 -0400 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:37576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUO3C-0001qz-Hg for emacs-devel@gnu.org; Sun, 26 Sep 2021 02:54:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=E1guQWSQTpJm2t+4AJ7pZ7OyUck+o8gQI//BiX/tvvw=; b=D9/aAyOdknjSn1nkFD2wWml1gK Fu+aP5RXMA/E7Djx5TLj2pCzq2m/sAi11Xtyjc+S1A+8rGrINp5q53xsv8SbXYTGAnP4z/GOMWgdE 9gWH1/3bI6cDtfzZNIpg8/3PIChVymQplx+kwI4OV9a92yK/OyF0tk47IcBXdbzLpOds=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mUO36-0006O5-Mf; Sun, 26 Sep 2021 08:54:11 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEX29fOCfHqhnptT T03////rCDt8AAAAAWJLR0QEj2jZUQAAAAd0SU1FB+UJGgYxMSvnjiEAAAGNSURBVDjL7dLhleUg CAVg5DUg0gBgA1H6720uZpLZPTslbH7kxHwCKhL9/jT6D/8Aq/0On1zPwP6CmfkMIhjvQeRpAE3M 1F0RHFAxyrwaqYRRy+wVj2Dxzpm7Ua6oP3lVKpQzN166q4YD9gQoVVgQX74QkUjPgy+KwaM+iTCt oJYr7eKwQPWGea6igArRuGpquLVexWYWKPG2aJ2x1g5om+WGIcPw70ORna3K+IFMGd2lT/bszWrz 84XLdQRgvKCVa8l27YQtH9iVai7IA2ut+xwj69gHcm3H4TWP0wNnAN9F9gTwHPLCKSJiM4c5Uh6I 0AMbY5Y6J7kKNLDBWm9HG3s1VibebEvyrtEdYQXVQsTueEFuOA9/MvQGq4j+3hDsQOXUMK8iFC9k tVXfGrXp0BXtB/T0saC+WkpBFdddF6tgpm7O8QPzgVVg6vdy5zX3d+GFLzUB6A3X92VeswNcACNt 9gc+ApADeeDT/4gAKNXa+rQf8E64XTeYnnt2YLgRLrySr1nwRMyO3k/AF412SSInY4N7AAAAJXRF WHRkYXRlOmNyZWF0ZQAyMDIxLTA5LTI2VDA2OjQ5OjQ5KzAwOjAwv6GqcAAAACV0RVh0ZGF0ZTpt b2RpZnkAMjAyMS0wOS0yNlQwNjo0OTo0OSswMDowMM78EswAAAAASUVORK5CYII= X-Now-Playing: Japan's _Quiet Life (3): Live At The Budokan 1980_: "Alien" In-Reply-To: <87k0j6gbjg.fsf@gmail.com> (akater's message of "Thu, 23 Sep 2021 22:41:23 +0000") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:275503 Archived-At: akater writes: > Fixes the following issues with cl-flet: > - No error on illegal function names > - No error on malformed specs > - Incorrectly treated (setf ..) local functions > - No warning on duplicated definitions > - No warning on unused definitions > - No way to capture definitions present in the body Sounds great. :-) I don't have any comments on the actual functionality, but just a couple of trivial notes: > -(defmacro cl--generic-with-memoization (place &rest code) > +(defmacro cl--with-memoization (place &rest code) Is there any reason for this renaming? > +(defun cl--flet-convert-with-setf (f) > + "Special macro-expander to rename (function F) references in `cl-flet', including (function (setf F)). The first line of the doc string should be a complete sentence (shorter than 80 characters). > +(defmacro with--cl-flet-macroexp ( arglist var > + function-name expander memoized-alist > + &rest body) > + "Return lambda (with ARGLIST being its arglist) that can > +serve as a macroexpanding function in > +`macroexpand-all-environment' to expand local function calls of > +the form (FUNCTION-NAME ..). Ditto (and the same for a couple more macros). Anyway, this sounds like good improvement for cl-flet, but I think it'll have to wait until Emacs 29 -- it's a too big a change to go into Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no