From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: RFC: String interpolation Date: Mon, 12 Dec 2016 08:03:41 -0500 Message-ID: References: <51825111-ace4-f750-4077-026a3b648d27@gmail.com> <8737hwnc52.fsf@lifelogs.com> <8c117f5c-209a-97d8-79ce-a78f707f0545@gmail.com> <76c9c475-0180-aa49-3d4a-006d4e3f943c@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1481549943 10090 195.159.176.226 (12 Dec 2016 13:39:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2016 13:39:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 12 14:38:59 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGQoj-0001tN-Io for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2016 14:38:57 +0100 Original-Received: from localhost ([::1]:49043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGQon-000731-T9 for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2016 08:39:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGQGg-0001yX-Lf for emacs-devel@gnu.org; Mon, 12 Dec 2016 08:03:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGQGc-0003qg-GB for emacs-devel@gnu.org; Mon, 12 Dec 2016 08:03:46 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:15109) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cGQGc-0003qX-AX for emacs-devel@gnu.org; Mon, 12 Dec 2016 08:03:42 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BtEQAu3EVY/2J8oWxdGgEBAQECAQEBAQgBAQEBgzgBAQEBAR+EW4VUhHiXMAGUVoIIGYYDBAICghFAFAECAQEBAQEBAWIohGkGViMQCzQSFBgNJIkCrRSLRAEBAQcCJYsZiikFjn99imqSc4gnhjqQToFBHzd4Ew6FcyCGcCqCEwEBAQ X-IPAS-Result: A0BtEQAu3EVY/2J8oWxdGgEBAQECAQEBAQgBAQEBgzgBAQEBAR+EW4VUhHiXMAGUVoIIGYYDBAICghFAFAECAQEBAQEBAWIohGkGViMQCzQSFBgNJIkCrRSLRAEBAQcCJYsZiikFjn99imqSc4gnhjqQToFBHzd4Ew6FcyCGcCqCEwEBAQ X-IronPort-AV: E=Sophos;i="5.33,749,1477972800"; d="scan'208";a="282368209" Original-Received: from 108-161-124-98.dsl.teksavvy.com (HELO pastel.home) ([108.161.124.98]) by smtp.teksavvy.com with ESMTP; 12 Dec 2016 08:03:42 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 5A25A6555D; Mon, 12 Dec 2016 08:03:41 -0500 (EST) In-Reply-To: (Lars Ingebrigtsen's message of "Mon, 12 Dec 2016 10:44:30 +0100") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:210335 Archived-At: > (let ((thing-formatted (replace-regexp-in-string " +" " " thing))) > (fmt "This is %{thing-formatted}.2f")) > > That is, you're forced to both name and introduce a new temporary > variable, and you have to alter the format statement itself. (This is > what PHP programmers do all the time, and it kinda sucks.) I see no need for renaming and altering the format statement itself: (let ((thing (replace-regexp-in-string " +" " " thing))) (fmt "This is %{thing}.2f")) > (fmt "This is %{thing}.2f" > :thing (replace-regexp-in-string " +" " " thing)) > > This sucks slightly less, in my opinion. I still don't see much difference. Stefan