From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nathan Trapuzzano Newsgroups: gmane.emacs.devel Subject: Re: Double unquote/unquote-splicing Date: Mon, 04 Nov 2013 14:09:11 -0500 Message-ID: <87habsdlwo.fsf@nbtrap.com> References: <87wqko6z8g.fsf@nbtrap.com> <874n7sf3pi.fsf@nbtrap.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1383592167 26595 80.91.229.3 (4 Nov 2013 19:09:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Nov 2013 19:09:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 04 20:09:32 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 1VdPWl-0005Vr-PW for ged-emacs-devel@m.gmane.org; Mon, 04 Nov 2013 20:09:31 +0100 Original-Received: from localhost ([::1]:51572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdPWk-0005Z3-VF for ged-emacs-devel@m.gmane.org; Mon, 04 Nov 2013 14:09:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdPWc-0005Yt-Fz for emacs-devel@gnu.org; Mon, 04 Nov 2013 14:09:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdPWW-00070n-W8 for emacs-devel@gnu.org; Mon, 04 Nov 2013 14:09:22 -0500 Original-Received: from outbound-ss-391.hostmonster.com ([67.222.34.81]:43693) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1VdPWW-00070U-NG for emacs-devel@gnu.org; Mon, 04 Nov 2013 14:09:16 -0500 Original-Received: (qmail 20052 invoked by uid 0); 4 Nov 2013 19:09:13 -0000 Original-Received: from unknown (HELO host393.hostmonster.com) (66.147.240.193) by oproxy4.mail.unifiedlayer.com with SMTP; 4 Nov 2013 19:09:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbtrap.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=ga7kr1M87GiuotokqBqF0S5nmn30ktUKHC8lYk/7/6g=; b=LIixNjAj0nEIfoKUAQ3knwo1FHOE/3VINh30Xfe+nbe9MLW4BpYo7LiAOzkENPf3tVnlz7V3BJNcUmVVUTyRmEkw61FH6BDjkwfYXEYW5P4nV86uQvBcMeIDJJqF+SGB; Original-Received: from [50.90.253.209] (port=48952 helo=Nathan-GNU) by host393.hostmonster.com with esmtpsa (TLSv1:CAMELLIA128-SHA:128) (Exim 4.80) (envelope-from ) id 1VdPWS-0000K1-NR; Mon, 04 Nov 2013 12:09:12 -0700 In-Reply-To: (Stefan Monnier's message of "Mon, 04 Nov 2013 13:33:15 -0500") User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3.50 (gnu/linux) X-Identified-User: {1585:host393.hostmonster.com:nbtrapco:nbtrap.com} {sentby:smtp auth 50.90.253.209 authed with nbtrap@nbtrap.com} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 67.222.34.81 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:164942 Archived-At: Stefan Monnier writes: >> This is incorrect. ``(a ,,@x) where x=(1 2 3) would evaluate to >> (\` (a (\, 1) (\, 2) (\, 3))). The first comma in ,,@ has the effect of >> being applied member-wise to each element spliced out of ,@. Cf. CLHS >> `Backquote' (http://www.lispworks.com/documentation/HyperSpec/Body/02_df.htm). > > This is even worse since it means that the expansion of ,@foo depends on > the context. Not necessarily. As I said, you could simply define \, and \,@ with more than one argument to behave the same as a series of \, or \,@s with one argument. In fact, I just built from trunk with two lines of code from backquote.el changed (using your helpful comments), and it seems to work precisely like that. In other words, this doesn't seem to require any extra work. >> "The backquote syntax was particularly powerful when nested. This >> occurred primarily within macro-defining macros; because such were coded >> primarily by wizards, the ability to write and interpret nested >> backquote expressions was soon surrounded by a certain mystique. Alan >> Bawden of MIT acquired a particular reputation as backquote-meister in >> the early days of the Lisp Machine." - "The Evolution of Lisp", Gabriel, >> Steele. > > That sounds about right: it's only for wizards. On second thought, that quote doesn't really support my argument. It's rather neutral. However, the fact is that nested backquotes _are_ for wizards. The problem is, Emacs' nested backquotes aren't fully functional, the result being that the code is harder for us non-wizards to read. In summary, this change would 1. break nothing, 2. require virtually no work to be done, 3. render macro-writing macros easier to read and write; and 4. bring Elisp behavior right in line with CL and Scheme. Even if you disagree with (3), this seems like a win all around.