From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Paul W. Rankin" Newsgroups: gmane.emacs.devel Subject: Improving aesthetics & readability of backquote Date: Mon, 20 May 2019 13:03:21 +1000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="148447"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.2.0; emacs 26.2 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 20 05:05:59 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 1hSYcg-000cSq-Ri for ged-emacs-devel@m.gmane.org; Mon, 20 May 2019 05:05:59 +0200 Original-Received: from localhost ([127.0.0.1]:56921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSYcf-0000Ul-Sj for ged-emacs-devel@m.gmane.org; Sun, 19 May 2019 23:05:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSYaI-00086G-NJ for emacs-devel@gnu.org; Sun, 19 May 2019 23:03:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSYaH-0007X2-Fa for emacs-devel@gnu.org; Sun, 19 May 2019 23:03:30 -0400 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:41277) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSYaH-0007Wg-2p for emacs-devel@gnu.org; Sun, 19 May 2019 23:03:29 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 56BD7323 for ; Sun, 19 May 2019 23:03:26 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 19 May 2019 23:03:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=from:to:subject:date:message-id:mime-version:content-type; s= fm3; bh=uaoGU6gw+uaTS3X0uV99qL6JjzSFbtQR5oPXGrnK2j8=; b=Q0fFBCgk vaZBrs/hPx16Iqlf8DDrwZJ1gq2GrtCbNSRiDrVSNq1z5BZU6gJYvE2FTl5eMjZr lM9Ev6ilWwxReEu4tPcVdOAYqonXu8h1p4IMbAEc47ZlykA3eTLHZK6Jce3NC10C VXOA8FBEkeUY2URuW5Ef7/9GQ0eTj1Xbj1EZ2qoJ1qLxv99cfYtkqScRdTa3TSEX QEHnOnyvGoqRkQn+WzOMWsIN4vWjORyx2hi1/7NMaUKY65yfeASWuwmK6PsoGSVD tVa1sSp7K7fOHI4KZ90yyql5hch7RqvBatw3cuyye342OcfGneNTpBCUSdn8jIzw b8vkrI5VE3ZAkw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=uaoGU6gw+uaTS3X0uV99qL6JjzSFb tQR5oPXGrnK2j8=; b=AliAzGbbQc1rTpqOOs8PMN/dRTRKm76IqE1yaclXe37XR dJhx9EQ8VgAv/T/Vo/iL32o0X/21EWC8vXLU3X6dRMFvbgUCy5VnLHX6VbzPUoIM I6SmubhMD/dOuuIAM8BTpZsHL4kXhbbU8Ws5rSRWq1tR3bJpFoVcQm9AKjqf7hb3 NXXbK/4EvjKpUfMBGPr6NDQfqslhNw0MNRYzbdvm5nPb3emOYa11wRdD7/BewN7W OFOS4gB6jcM8QIHkZzu1Qwgj23eaMtThSVLIKnOSGKc4X1qOJnln8od/Ac5C+Lsp B36MMOdf3eObcPglOsLtnEUzV4r6WV7N23bbZOsFg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtjedgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegfhffvufffkfggtgesthdtredttd ertdenucfhrhhomhepfdfrrghulhcuhgdrucftrghnkhhinhdfuceohhgvlhhlohesphgr uhhlfihrrghnkhhinhdrtghomheqnecuffhomhgrihhnpehprghulhifrhgrnhhkihhnrd gtohhmpdhfrghmihgtohhlrdhinhdpghhnuhdrohhrghenucfkphepudeggedrudeftddr udehiedruddvleenucfrrghrrghmpehmrghilhhfrhhomhephhgvlhhlohesphgruhhlfi hrrghnkhhinhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Original-Received: from localhost (unknown [144.130.156.129]) by mail.messagingengine.com (Postfix) with ESMTPA id EC1248005B for ; Sun, 19 May 2019 23:03:24 -0400 (EDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.147.123.19 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:236769 Archived-At: wrt. http://lists.gnu.org/archive/html/help-gnu-emacs/2019-05/msg00022.html I understand that aesthetics and readability are not going to be a concern for many, but I'd like to put forth this suggestion anyway. For as long as I've used Emacs Lisp, I've found the backquote[1] to be ugly and unreadable, to the extent that I've gone to lengths to avoid using it. It looks like a mistaken quote added by someone using an unfamiliar keyboard. Then when you add the splice... ugh.. (setq a '(3 4)) (setq b '(6 7)) `(1 2 ,a 5 ,@b 8) -> (1 2 (3 4) 5 6 7 8) I know people make fun of Perl for being "line noise"[2] and IMO the backquote approaches that. Add to this the \` is just an alias for backquote, which doesn't imply any meaning except as relation to itself. Its meaning cannot be inferred through the code alone. I suggest that we could introduce some aliases and augment the reader constucts a little to make them more aesthetically pleasing and more readable. The easy first step would be chosing a nice and meaningful alias for backquote. Considering the semantic role of backquote seems to be both to "quote" and selectively "eval" its body form, and together with the tradition of Emacs Lisp making contractions from e.g. "define" + "function" -> "defun", then I suggest: (quoteval ...) Which sits similarly to: (quote ...) (eval ...) Then it would be a case of augmenting the "unquote" ,VAR and "splice" ,@VAR reader constructs: (quoteval (1 2 (unquote a) 5 (splice b) 8 )) -> (1 2 (3 4) 5 6 7 8) (Both "insert" and "unquote" are used in backquote.el; I lean towards "unquote" because there is already the function "insert".) Although the above is more verbose, to me this is immediately clear what's happening in the code, and is much more aesthetically pleasing. If it remains unclear, my suggestion is not to supplant the original syntax; I position this suggestion in a similar vein as the rx library. Thoughts? [1]: (info "(elisp) Backquote") [2]: https://famicol.in/sigbovik/ -- https://www.paulwrankin.com