From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robin Tarsiger Newsgroups: gmane.emacs.devel Subject: Re: Some improvements for cl-flet Date: Mon, 11 Oct 2021 19:29:27 -0500 Message-ID: <1792c161-ffc4-76b8-1b54-9376703b1e80@dasyatidae.com> References: <87bl4zqnqn.fsf@gmail.com> <87czpe4rj2.fsf@web.de> <874kaqqxe7.fsf@gmail.com> <87y281cowz.fsf@web.de> <87sfxdr2ds.fsf@gmail.com> <877demdb5w.fsf@gmail.com> <87tuhq20tp.fsf@web.de> <87czodcgby.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23445"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 12 02:32:30 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 1ma5iW-0005rv-9k for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Oct 2021 02:32:29 +0200 Original-Received: from localhost ([::1]:45248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ma5iU-0008KM-N1 for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Oct 2021 20:32:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ma5fh-0007Mt-ES for emacs-devel@gnu.org; Mon, 11 Oct 2021 20:29:33 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:41243) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ma5ff-0002aW-Hb for emacs-devel@gnu.org; Mon, 11 Oct 2021 20:29:33 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4E6625C00AC for ; Mon, 11 Oct 2021 20:29:29 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 11 Oct 2021 20:29:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dasyatidae.com; h=message-id:date:mime-version:to:references:from:subject :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=f TNOsOLcwqH0d198lNSHLPSQYncqEh2pKV/TzWcUEug=; b=chEuFDxMysDpz5Wv8 CwP4dWsQDTaQHgwjooCAjINdgJQr522YyDP6ggWQYmCVZ7am9SRRCDhG52zp08Iv aeAytiQE0pVCGhfi3sPloL5TI6dAu4y/uMua4vqiXSw/+9ZP7CTTDVo84dKwLNK+ barjeIcF2idrDndG9nsVN3F9FPdBAbxRXJJGOEjqzixMHzSva+szHDGfSUuU/GHF EqsNQ6IXJZI/tx0oSQ/iqJy3ge8F6gQDeKCoKklp1oQb7oh5yZ6bdq5Otvv/r0re KoYvXJ+sMAXCFTyZf1SC8+k1M0nikz94nx2O8wry/TQzR6yy4+OFWR+zyUZc68Q1 y8pbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=fTNOsOLcwqH0d198lNSHLPSQYncqEh2pKV/TzWcUE ug=; b=N/9caQoRqPbTlQUxQ2CMM2sTH6QEmkfnyHLeRhzUF2le8LYXcXNwftR9K MesFnsr1PjyXlsTB5e+a3uDT8fhK4lvd4zEAF714T0bGjOxFLJJ8V7FmhbaibKyM 0JHPgClJjWqFaKnVavwbQkTy8/vbcYgsKR+6A6biT0y5836oCTnDNXzvyH6rro4s Nhz3KFBU2QVaJ57mFcK5fRUVnt0D18L6BribiXscBCS7Q2GZ6pIhzkjJooyipfhv WvKaBcd2Vbdqm2qbl/UmqBTc7WsI76cjlhoRHxgSWZJV0Tka0FFnVKtt1CQQQFZA Dux5VHQ9zWOrVKc6p9QkP2NMC+iGw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtjedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfvfhfhufgjtgfgsehtje ertddtfeejnecuhfhrohhmpeftohgsihhnucfvrghrshhighgvrhcuoehrthhtsegurghs higrthhiuggrvgdrtghomheqnecuggftrfgrthhtvghrnhepkeetjeffheejgeejgfdvud euffeiudfhieffgeetuefgheeigeetiefhueegteffnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomheprhhtthesuggrshihrghtihgurggvrdgtoh hm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 11 Oct 2021 20:29:28 -0400 (EDT) Content-Language: en-US-large In-Reply-To: Received-SPF: pass client-ip=66.111.4.28; envelope-from=rtt@dasyatidae.com; helo=out4-smtp.messagingengine.com 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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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:276760 Archived-At: Richard Stallman wrote: > > Yes, but SYMBOL-MACROLET is relatively common in Common Lisp programs, > > which in itself warrants its inclusion in a Common Lisp emulation > > library, IMO. > > I am sure you know what you're referring to. But I am shocked this > would be used frequently. Can you plesae show me why and how? One key category of use is for macros that take a body and want to expose variable-like places to that body. For instance, there is the with-slots macro which binds convenience aliases for slots of a CLOS object, so that: (with-slots (foo bar) object (setf foo bar)) is equivalent to: (setf (slot-value object 'foo) (slot-value object 'bar)) and with-slots can be implemented using symbol-macrolet. Alternatively, any other place where a macro wants to expose a symbol which may or may not be a local variable proper in every case, while preserving a compatible interface with the provided body, may use symbol-macrolet to provide this decoupling. It is much less common to use symbol-macrolet directly in application code, though once or twice I have seen it used for local constants in a manner similar to how parameterless C macros are used for constants. -RTT