From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: let-alias Date: Wed, 6 May 2020 22:31:57 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="121666"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 06 22:33:08 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 1jWQj6-000VYF-Ag for ged-emacs-devel@m.gmane-mx.org; Wed, 06 May 2020 22:33:08 +0200 Original-Received: from localhost ([::1]:38304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWQj5-0007VO-8g for ged-emacs-devel@m.gmane-mx.org; Wed, 06 May 2020 16:33:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWQiC-0006yN-Gp for emacs-devel@gnu.org; Wed, 06 May 2020 16:32:12 -0400 Original-Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]:40466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jWQiB-00018f-0F for emacs-devel@gnu.org; Wed, 06 May 2020 16:32:12 -0400 Original-Received: by mail-oi1-x22f.google.com with SMTP id t199so3006501oif.7 for ; Wed, 06 May 2020 13:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LdTKqO0eE9LdkSh5kOupq0djvDtmk79Uwth+58UwC3I=; b=nZstHqFywcnmK9cghhk8zX/81lsq964yDVsFOX97HmXQd75Oz4J8kyPOXKYbUOGP2z DxqwRF2sVFjT9Paa1dupehnGNSBhEvMOYA8AnDhxR6wZ3G1oRByW4x5sYotY8gt8pOUJ 9//SZrxhJyJ4UZOtNCZfchj3Oj27CNcsAWjk8Glkk6mlqeVm1BWNFAjDeNYmrXQLvB+g +5JERzSENrypUQp1zsAvv3BgcfavwqiabEe/GmN3A1v6YMCHm3JpRiKLTtKh8X8RQpVj TTHNvFfCmexfbqtlJYVdvlEfV+O06rdOro1b6OfVudlM97HWSiAhbo4JE0KB6pWt4sal VORg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LdTKqO0eE9LdkSh5kOupq0djvDtmk79Uwth+58UwC3I=; b=uiMjrJpOL2uRG9JXT1pXHt1M0FWtV2lTIVtnAkVCFOo4rIWk5yDCs6ijSO+J4IPPNb ErwmkwlhkjIUpzSZezDfbTmFYXJ7u1I2B2FY3odwBbqQa6UfUW6Tx2jX3lLI5yXHqtmN TdUZzQOFE/JQk5DH5i8coOw3h02056idb/+Fzxx0yokbmQa0vIKTHgn+Wq1OiItXCcgJ 5sITgnUhVL2q969KXwls4E82YxYzw9fMgrWkAHzsf46LnYE6fvZ/G3eFYg5kM4ZOfdoH QWHOEd0ddy6Jt0Nb0ZQN8W4QIoFY9Az2tde4solgfXtB9o/NET/wFazboBa68IqihSXh ib/w== X-Gm-Message-State: AGi0PubUEE6XBXUv/g5Hi5Pj3KHqHlQpinSmPGV5m0jLaeH2UZnvfrqQ up3xHEjc88U0vT4sCkL1jCWmBECol3aJB05ijXM= X-Google-Smtp-Source: APiQypKzi+4CS0Fcpu3XtNs8KbpbzomJrp2usQLFKn4nhP7a4KpH6LQyFoucpxHlby7ufcNw0+dwUI7XGC8NzVr2X8s= X-Received: by 2002:aca:f182:: with SMTP id p124mr4215831oih.170.1588797128245; Wed, 06 May 2020 13:32:08 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::22f; envelope-from=p.stephani2@gmail.com; helo=mail-oi1-x22f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:249120 Archived-At: Am Mi., 6. Mai 2020 um 20:51 Uhr schrieb Helmut Eller : > > 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? If you don't mind the quoting, you can use (cl-flet ((c #'car)) ...)