From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Double unquote/unquote-splicing Date: Mon, 04 Nov 2013 12:27:00 -0500 Message-ID: References: <87wqko6z8g.fsf@nbtrap.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1383586037 16986 80.91.229.3 (4 Nov 2013 17:27:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Nov 2013 17:27:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Nathan Trapuzzano Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 04 18:27:21 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VdNvt-0002Kx-5p for ged-emacs-devel@m.gmane.org; Mon, 04 Nov 2013 18:27:21 +0100 Original-Received: from localhost ([::1]:51211 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdNvs-0001DZ-Pi for ged-emacs-devel@m.gmane.org; Mon, 04 Nov 2013 12:27:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdNvi-0001DR-MX for emacs-devel@gnu.org; Mon, 04 Nov 2013 12:27:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdNvb-00080a-8g for emacs-devel@gnu.org; Mon, 04 Nov 2013 12:27:10 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:55035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdNvb-00080F-4u for emacs-devel@gnu.org; Mon, 04 Nov 2013 12:27:03 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFxLzd/2dsb2JhbABEvw4Xc4IfAQVWIxALDiYSFBgNJIgkwS2RCgOIYZwZgV6DFQ X-IPAS-Result: Av4EABK/CFFFxLzd/2dsb2JhbABEvw4Xc4IfAQVWIxALDiYSFBgNJIgkwS2RCgOIYZwZgV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="37057182" Original-Received: from 69-196-188-221.dsl.teksavvy.com (HELO pastel.home) ([69.196.188.221]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 04 Nov 2013 12:27:02 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id B7C166012B; Mon, 4 Nov 2013 12:27:00 -0500 (EST) In-Reply-To: <87wqko6z8g.fsf@nbtrap.com> (Nathan Trapuzzano's message of "Mon, 04 Nov 2013 09:03:11 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164935 Archived-At: > (defmacro once-only (names &rest body) > (let ((gensyms (loop for n in names collect (gensym)))) > `(let (,@(loop for g in gensyms collect `(,g (gensym)))) > `(let (,,@(loop for g in gensyms for n in names collect ``(,,g ,,n))) > ,(let (,@(loop for n in names for g in gensyms collect `(,n ,g))) > ,@body))))) There are two reasons why I'm resisting it: 1- the above code looks clean, but I can't understand it at all. Your alternative code is less clean and not easy to understand, but I *can* understand it. 2- Since we don't allow (\` (a (\, 1 2 3))), it's weird to allow ``(a ,,@x) since one possible expansion for it when x=(1 2 3) is (\` (a (\, 1 2 3))). Another way to say it is that we should allow (\, 1 2 3) and (\,@ 1 2 3), but that can't be used with the ,e and ,@e syntax, so it'll stay as a second-rate citizen. Isn't the above the same as (defmacro once-only (names &rest body) (let ((gensyms (loop for n in names collect (gensym)))) `(let (,@(loop for g in gensyms collect `(,g (gensym)))) `(let (,@(list ,@(loop for g in gensyms for n in names collect ``(,,g ,,n)))) ,(let (,@(loop for n in names for g in gensyms collect `(,n ,g))) ,@body))))) -- Stefan