From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Adding with-gensyms and once-only to subr-x Date: Mon, 11 Apr 2022 17:06:36 -0700 Message-ID: <87bkx7tbar.fsf@melete.silentflame.com> References: <87sfqja2eu.fsf@melete.silentflame.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="37668"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 12 02:07:45 2022 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 1ne44N-0009bq-SL for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Apr 2022 02:07:45 +0200 Original-Received: from localhost ([::1]:35992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ne44M-0003Bb-Py for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Apr 2022 20:07:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ne43O-0002Ts-By for emacs-devel@gnu.org; Mon, 11 Apr 2022 20:06:42 -0400 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:46515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ne43M-0006Qu-5t for emacs-devel@gnu.org; Mon, 11 Apr 2022 20:06:42 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id A83A2320207B; Mon, 11 Apr 2022 20:06:38 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 11 Apr 2022 20:06:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1649721998; x=1649808398; bh=h8 NkREV6l9ghl+bPSj4U9kCIDpco7UUSUFJmIadbAaU=; b=WAYKJcweTVi1oILNvr 8ojZHb8hbrV6b8P3gIKlcC8q5CIYqSD73Wx1+cao4ZeQkGy39iRia/l4nfvdkCYZ iooyAsq8mpVrJf1e9v0gLgRutQK7k+pE9tbvZuJikccyTIzsfc35HEiKnR4wJQh1 uNiBu5a0u6pwJUC9knQsoIs35XkpszgBgx/wvy+tyLOmLZzBtIDeRkWSY/UwBDpX BrFsDbk4Foc138EhM6x2i12Tq5FMzcfSA+u4XcaWDEdVNuv+16BXSpK6WU5khSdw b2INb6MeZHL5H4chvECElOGntVokU5vW9r5bJ4e6CgEvNI6SQRM2vz4Q7EZLHmMN 3laA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1649721998; x= 1649808398; bh=h8NkREV6l9ghl+bPSj4U9kCIDpco7UUSUFJmIadbAaU=; b=L yz6LW/LWMjy0dtNJDe2dJtFcJgjzpH04CKzgpC8qrCr9wtzUNWIrbY6Qjr5/U7VF XPXX2xv1IXehJhC7N02R1qy9iww6tIsWqA1NAj15hLf+pm05lt1Hzft5AzJnkuBz 4osIncKMVt7lUKO1HH+qohuuxg5AlpLKUvAsTAdzsiBip2qlGf0EKGW/qRXWMors 5rMW5hhtOb62GmwutB2ty2TOixE7+4wHVQfrIb2TgYiDQLZD5ZP6d9h2BbURskJ1 /P5A7Li6iot1Bb1em0F7PP6cPcZjf8KweHCprspP1KMDEiUbopZ4l9mNYp4r7Lii NQaenqQgEG2/Iv5WZIqow== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekjedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnheptdeivdehffeuteekgeegfedvvdehudeijeffhfduieehgeev heevfeeiiedvudeknecuffhomhgrihhnpegvlhdruggvrghlnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshhpfihhihhtthhonhesshhpfihh ihhtthhonhdrnhgrmhgv X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Apr 2022 20:06:37 -0400 (EDT) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id D95627E47FD; Mon, 11 Apr 2022 17:06:36 -0700 (MST) In-Reply-To: Received-SPF: pass client-ip=64.147.123.20; envelope-from=spwhitton@spwhitton.name; helo=wout4-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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.devel:288256 Archived-At: Hello again Stefan, On Mon 11 Apr 2022 at 03:11PM -04, Stefan Monnier wrote: >>> I'm not in love with the name `macroexp-let2*` but I find the name >>> `once-only` to lack context. So we could consider renaming, but I'd >>> favor making it live in `macroexp.el` (and come with a `macroexp-` >>> prefix). It could be called `macroexp-once-only` or >>> `macroexp-eval-now`, or we could go crazy with names like >>> `macroexp-copyableize`. >> >> How about I add an alias cl-once-only, maybe which doesn't accept the >> TEST argument at all? It can go in cl-macs.el. > > Deal! > [ I didn't know it was "standard" in Common-Lisp. ] I've found a snag. CL once-only uses let but macroexp-let2* uses let*. For the example (defmacro square2 (x y) (cl-once-only (x y) `(* ,x ,x ,y ,y))) the macroexp-let2* version yields something like (let* ((x foo) (y bar)) (* x x y y)) whereas CL's traditional once-only would be more like (let ((x foo) (y bar)) (* x x y y)) where x and y are uninterned symbols. At the very least this should be noted in the docstring for cl-once-only, but maybe it means cl-once-only should use the code in my original patch and not use macroexp-let2* at all? What do you think? -- Sean Whitton