From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: let-alias Date: Wed, 06 May 2020 20:50:27 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="67196"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:H728kDSeqUALmG3IBTsRiegLSpM= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 06 20:51:19 2020 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 1jWP8Z-000HLs-Af for ged-emacs-devel@m.gmane-mx.org; Wed, 06 May 2020 20:51:19 +0200 Original-Received: from localhost ([::1]:58758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWP8Y-0004U9-Dz for ged-emacs-devel@m.gmane-mx.org; Wed, 06 May 2020 14:51:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWP7u-00045J-0s for emacs-devel@gnu.org; Wed, 06 May 2020 14:50:38 -0400 Original-Received: from ciao.gmane.io ([159.69.161.202]:50196) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWP7t-0003Lb-Ce for emacs-devel@gnu.org; Wed, 06 May 2020 14:50:37 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jWP7p-000GVk-JM for emacs-devel@gnu.org; Wed, 06 May 2020 20:50:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=159.69.161.202; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/06 14:50:34 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: 3 X-Spam_score: 0.3 X-Spam_bar: / X-Spam_report: (0.3 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NML_ADSP_CUSTOM_MED=0.9, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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:249112 Archived-At: After the recent discussion about namespaces, it occurred to me that it would be useful to have a special form that allows one to create lexically scoped aliases for function bindings. The idea is quite simple and is supposed to provide a locally scoped version of defalias. A possible syntax would be: (let-alias ((new-name old-name) ...) body...) Inside BODY, wherever NEW-NAME is used as function name it should produce the same result as using OLD-NAME would. E.g. (let-alias ((c car)) (c x)) === (car x) (let-alias ((c car)) #'c) === #'car (let-alias ((c car)) (setf (c x) y)) === (setf (car x) y) (let-alias ((when-not unless)) (when-not x y)) === (unless x y) Would somebody be opposed to such a new special form? Or better yet, is there already some way to achieve this? Helmut