From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Improving aesthetics & readability of backquote Date: Wed, 22 May 2019 11:44:11 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="118137"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 22 17:52:26 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTTXR-000USK-Jr for ged-emacs-devel@m.gmane.org; Wed, 22 May 2019 17:52:21 +0200 Original-Received: from localhost ([127.0.0.1]:46473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTTXQ-0000Cp-Hm for ged-emacs-devel@m.gmane.org; Wed, 22 May 2019 11:52:20 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTTPr-0002Pv-NI for emacs-devel@gnu.org; Wed, 22 May 2019 11:44:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTTPo-0007oo-Gv for emacs-devel@gnu.org; Wed, 22 May 2019 11:44:31 -0400 Original-Received: from [195.159.176.226] (port=45170 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTTPo-0007WO-1r for emacs-devel@gnu.org; Wed, 22 May 2019 11:44:28 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hTTPi-000Kms-FJ for emacs-devel@gnu.org; Wed, 22 May 2019 17:44:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:ywn/1fo5hEcm7lAhEj9kzl58tr4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:236898 Archived-At: > is complemented by > > `E => (quasiquote E) > ,E => (unquote E) > ,@E => (unquote-splicing E) > > Elisp doesn't have that, mostly for historical reasons, I think. To clarify, Elisp doesn't have exactly the above, but it does have: `E => (\` E) ,E => (\, E) ,@E => (\,@ E) so you *can* write them in "normal Lisp parenthesized syntax". It's just that this syntax doesn't use English words to carry an intended semantics. Regarding adding alternate names, there are two separate aspects: - What should the reader return: changes there (e.g. making it return the same as Scheme does, for example) are hard to justify because the gain is not great but it introduces backward-incompatible changes, and will inevitably break existing packages. - Allow Elisp code to use alternate names. This is already allowed when it comes to `E which can be written (backquote E). A simple (defalias 'quasiquote #'backquote) would also add the traditional Scheme name if we want it. That's easy and safe. Extending this to (unquote E) and (unquote-splicing E) is more problematic because that would be a backward-incompatible change. Currently `(unquote (+ 1 2)) returns (unquote (+ 1 2)) this would change it to return 3. I'm not 100% it would break existing packages (contrary to the previous point), but the risk is still pretty high and the payoff rather small. IOW, I think the "core Elisp" support for `E and ,E is unlikely to change because even if there might be a benefit, it's likely not high enough to justify the pain inflicted by the change itself. OTOH we could define a new `quasiquote` macro which does the same as `backquote` except that it additionally accepts (unquote E) and (unquote-splicing E) as replacements for ,E and ,@E. That can easily be done even in a GNU ELPA package and doesn't risk breaking existing code. Not sure such you'd find such a "2nd rate citizen" solution very convincing, tho. Stefan