From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: (format "Hello %1$S%2$s" 'world "!") Date: Fri, 22 Dec 2017 21:48:10 +0000 Message-ID: References: <061782A1-0A51-49A1-9AA4-706AF8927D01@gmail.com> <94EF128F-6A3D-41DD-B92D-0C165A4A8EB9@gmail.com> <617557F2-0316-4504-BE80-E7F29E4EE347@gmail.com> <86E604C6-4A01-42D2-A3CD-D758FC5DD8B1@gmail.com> <6fc86e25-4515-0787-d984-9160bc9c15e7@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1147e32c707df00560f4c659" X-Trace: blaine.gmane.org 1513979228 21507 195.159.176.226 (22 Dec 2017 21:47:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 22 Dec 2017 21:47:08 +0000 (UTC) Cc: Emacs developers , Noam Postavsky To: =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 22 22:47:04 2017 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 1eSV9f-00054U-CJ for ged-emacs-devel@m.gmane.org; Fri, 22 Dec 2017 22:46:59 +0100 Original-Received: from localhost ([::1]:39231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSVBd-00050K-Oe for ged-emacs-devel@m.gmane.org; Fri, 22 Dec 2017 16:49:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSVB1-00050E-0q for emacs-devel@gnu.org; Fri, 22 Dec 2017 16:48:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSVB0-0003SD-0C for emacs-devel@gnu.org; Fri, 22 Dec 2017 16:48:23 -0500 Original-Received: from mail-qk0-x22e.google.com ([2607:f8b0:400d:c09::22e]:45452) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eSVAz-0003Rw-QH for emacs-devel@gnu.org; Fri, 22 Dec 2017 16:48:21 -0500 Original-Received: by mail-qk0-x22e.google.com with SMTP id o126so23874783qke.12 for ; Fri, 22 Dec 2017 13:48:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NYxkulgHKezR35M4//4/pxzXmLb2HxfoN1M66oAj0A4=; b=aUSmaNJDay5uILlcNOYBMP3Fcv1IelF6LSYW0D/veLQdr5MMQVZzNrc/ZLVsdR75bR 4Kiwfk1cvLn80VMPOBtz3UY2kH1i5etBJ2QTbxob7wf4ZXYb65p/Ea3yqFftpQtxl79m bcjmDnDAdwEbmtTxKeU2UAcVhMW0Qv3GAivgTJWZZA3G/qrkoF6vu+nlDoPkbEAKS0yH 209ipjPYCvAtcSo0BeePwvFd5o2Ag9vV2WwS0pCjk+BmEoCwao58Jg1Xnc6CJ0wyN/JN 5/2O+o4rt/Wqd/25ByeKRpxk46RbyGc2l7vpLQkR2cGoKldOsFIJkb1E8DlZvHkk+AYt urCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NYxkulgHKezR35M4//4/pxzXmLb2HxfoN1M66oAj0A4=; b=Cb0N9Q/HtycVLCheS0syD/IvhSJt1/GUqCnRmAsaf1bkxMuGL6PMyknWbwLQ3HHzGL /tro8i3WePRdDRTBS0TdSC1m/AjbAkjZxhxV6/nFe2EWBotwr7PfQkExRO5FFzNLqv6T YpsJOlUYQwu8XvyBejgZblgFM2gS8ndMChgzxo9+DExxd1yWnpKuQFSYlZktqXrasA1r gbK0n+L/Jl5hmmYOgEwYkxmKSdtvEa6/l/QGcxV4ShCfdkggKPNqm8MlY4px72BgX421 Rad+k7YnNbCXdJFGdJLSIVevbZn0HKIkEekekTwmz43uUOK+9dWpEgWr/+7lKjkYo9O0 jnEw== X-Gm-Message-State: AKGB3mJ1eFd1uxQDt3KT/x1Vrqeo3kH8d7JJZNFTJ5CqWSsbSXrJY1S2 cXL7s0v4fwDF2rTCQKMG/j7XgwjqEEcoH6OE/pc= X-Google-Smtp-Source: ACJfBovEbP/Swo1K4vBBKFDyHyLYXjzRhJP/DxRwQiuxKu2tDEVYbkTQCkCS4VBLpQvoA2yb6fzunHbUtxkCseJSdLU= X-Received: by 10.55.31.96 with SMTP id f93mr21909566qkf.151.1513979301098; Fri, 22 Dec 2017 13:48:21 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22e 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:221358 Archived-At: --001a1147e32c707df00560f4c659 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cl=C3=A9ment Pit-Claudel schrieb am So., 2. Juli 20= 17 um 18:34 Uhr: > On 2017-07-02 11:03, Noam Postavsky wrote: > > > Why would we need a new function since %n$ would be an error for the ol= d > format anyway? > > This in itself is a good reason to have a new function. A new function > lets you migrate existing code, including plugins, to the new syntax, and > load the polyfill in older Emacsen. A new syntax that causes errors in o= ld > Emacsen isn't usable by anyone outside of Emacs core, for fear of > compatibility problems. > We extend functions all the time. Here's a random entry from NEWS: *** Time conversion functions now accept an optional ZONE argument that specifies the time zone rules for conversion. ZONE is omitted or nil for Emacs local time, t for Universal Time, 'wall' for system wall clock time, or a string as in the TZ environment variable. The affected functions are 'current-time-string', 'current-time-zone', 'decode-time', and 'format-time-string'. The function 'encode-time', which already accepted a simple time zone rule argument, has been extended to accept all the new forms. There's no difference between those changes and this one: the new syntax was an error before, but now has a specified meaning. > > Also, the syntax is very heavy. Was it inspired by another programming > language? The ones I'm familiar with use $1, {1}, or similar syntax, but > I've never seen %1$s :/ > > As said, it comes from GNU printf. We need to use a syntax that's backwards-compatible, that rules out $1 or {1}. --001a1147e32c707df00560f4c659 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Cl=C3= =A9ment Pit-Claudel <cpitclaude= l@gmail.com> schrieb am So., 2. Juli 2017 um 18:34=C2=A0Uhr:
On 2017-07-02 11:03, Noam Postavsky wrote:=

> Why would we need a new function since %n$ would be an error for the o= ld format anyway?

This in itself is a good reason to have a new function.=C2=A0 A new functio= n lets you migrate existing code, including plugins, to the new syntax, and= load the polyfill in older Emacsen.=C2=A0 A new syntax that causes errors = in old Emacsen isn't usable by anyone outside of Emacs core, for fear o= f compatibility problems.

We extend fun= ctions all the time. Here's a random entry from NEWS:

*** Time conversion functions now accept an optional ZONE argu= ment
that specifies the time zone rules for conversion.=C2=A0 ZON= E is omitted or
nil for Emacs local time, t for Universal Time, &= #39;wall' for system wall
clock time, or a string as in the T= Z environment variable.=C2=A0 The
affected functions are 'cur= rent-time-string', 'current-time-zone',
'decode-t= ime', and 'format-time-string'.=C2=A0 The function 'encode-= time',
which already accepted a simple time zone rule argumen= t, has been
extended to accept all the new forms.

There's no difference between those changes and this on= e: the new syntax was an error before, but now has a specified meaning.
=C2=A0

Also, the syntax is very heavy.=C2=A0 Was it inspired by another programmin= g language?=C2=A0 The ones I'm familiar with use $1, {1}, or similar sy= ntax, but I've never seen %1$s :/


As said, it comes from GNU printf.
We need to use a syntax that's backwards-compatible, that rules = out $1 or {1}.=C2=A0
--001a1147e32c707df00560f4c659--