From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.devel Subject: Re: format use inquiry Date: Sat, 1 Jul 2017 13:38:50 +0900 Message-ID: <2CC7167F-53F8-4676-BA51-4C68F25108BC@gmail.com> References: <7e7f068e4e.fsf@fencepost.gnu.org> <2FDCF579-44BC-49AD-985F-14AE5C654645@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1498883953 16093 195.159.176.226 (1 Jul 2017 04:39:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 1 Jul 2017 04:39:13 +0000 (UTC) To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 01 06:39:08 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 1dRABR-0003Xr-U5 for ged-emacs-devel@m.gmane.org; Sat, 01 Jul 2017 06:39:02 +0200 Original-Received: from localhost ([::1]:46854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRABX-0005Qb-1W for ged-emacs-devel@m.gmane.org; Sat, 01 Jul 2017 00:39:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRABQ-0005QV-M2 for emacs-devel@gnu.org; Sat, 01 Jul 2017 00:39:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRABM-0007QS-9r for emacs-devel@gnu.org; Sat, 01 Jul 2017 00:39:00 -0400 Original-Received: from mail-pg0-x22f.google.com ([2607:f8b0:400e:c05::22f]:36513) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dRABM-0007PM-27 for emacs-devel@gnu.org; Sat, 01 Jul 2017 00:38:56 -0400 Original-Received: by mail-pg0-x22f.google.com with SMTP id u62so71971147pgb.3 for ; Fri, 30 Jun 2017 21:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=Xey+d1GDyCjUnzMGfUo/SgfIYzyxDmjKVmYNt3Z1P+E=; b=DgaFRHaq5azZs4SfveYZiXBvScr+gZ+UtdI9cOB+u1KADEQTQYpUzuvI9t9KZYHvS3 NxlDderqx7xrcRhIuQF+9FKj7YwvSP9+yV4FY7Ym00+GehvoXjPcti2zusTkY7K5TU3L WhR1J5VpC+fv/NmZFh3QPbj+EpyQEA1M2DgYXrMnbXfs31+yhSAvZl+VFOk/5G3J8m7b Yn05iCWgsv/TYF/HwSQ5xPbvSMBfdnyMPCKAxQJRGI+9i7uhXDIThBvlhrpKKQ6RssK1 2GVl8OvebRWTxY9YLHH7SMgJkydaqCoNMUySqiz9IHO/2XBeLva7/xe1gIo8SBYHzbcB c/9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=Xey+d1GDyCjUnzMGfUo/SgfIYzyxDmjKVmYNt3Z1P+E=; b=D0C3vu2vM3fqv1rtyHr+ZWKaPzKS4NRuzVUuhg6tsNbs51cYWGoV1FPbRGNAI5iNq1 bazJqRWK1uUFIAqfDTklk+xPuPRkUl1ZAq5WSAjmYnCAAdx3o7Zm0yHW0qGbfaAvHyUT 9trLwfe/TceyhTSLfiE8/d5WvGHKPo1ki9fGEgybqfmRxlxN8Yxx/8VtGSP+GcxkQcbT HymN2cRvnWC1DtQKmDSUYggac8916b8lPm/KeZOaGWVtgkpj2iJzN7LJtcfrT9CoToR4 7kVZvIjvrhwReeppsgt1IRn7332Uf5ouKo2iHmhdyku5aQ416DfIHpdy/Y+E6JPIHsN+ wlHg== X-Gm-Message-State: AKS2vOyZ07ZWJ4k7M1xmpZMymGGh/50lz97Zt4oOcY/cARR3byC+ukth 0hii8YgiR4XLl+iEF60= X-Received: by 10.84.197.129 with SMTP id n1mr27875728pld.179.1498883933051; Fri, 30 Jun 2017 21:38:53 -0700 (PDT) Original-Received: from [192.168.24.55] (pl2587.ag0304.nttpc.ne.jp. [128.53.196.27]) by smtp.gmail.com with ESMTPSA id a71sm22488761pfl.129.2017.06.30.21.38.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jun 2017 21:38:52 -0700 (PDT) X-Priority: 3 In-Reply-To: X-Mailer: Apple Mail (2.3273) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::22f 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:216071 Archived-At: > On Jul 1, 2017, at 11:32, Drew Adams wrote: > But if we're > talking about a wholesale change then maybe some > better approach can be found. I am certainly not talking about a *wholesale change* but about *1* = instance in the emacs sources that uses that pattern. Also, I don't think that *code* is especially bad, but considering what = I have seen in the rest of the package.el code, this looks more like a = way of thinking about natural language strings from the authors than = about some kind of natural lispy rationalization. Btw, I like your: (let ((https "https://elpa.gnu.org/packages/") (http "http://elpa.gnu.org/packages/")) (if (gnutls-available-p) https http)) That's something like that that I had in mind. I am not conflating l10n and anything else btw. But it happens that = authors who tangle code and strings in general do that all the time = without considering whether the strings they create are internal or = external strings. That leads to real problems: my first interest in = package.el came from a number of singular cases that were not handled, = then I checked the code and I found the external strings had *lots* of = problems (and lots of "rationalizations" to save a few lines that ended = up creating strings *totally* unlocalizable). > Just one opinion. And mine was equally just one opinion, based on greping about a 100 = other .el files to find similar patterns, where I found that (seemingly) = robust code would prefer redundancy to smarty formatting. You may want to compare the tons of redundant urls in = auth-source-pass-tests.el to that one instance where using format saved = the code a few characters (and I'm really not sure it adds much in terms = of readability). > As for the question of messages that use singular > vs plural forms, I'd again point to Common Lisp's > `format', which addresses that kind of thing (at > least for English). Again ? Sorry if I missed the other references. That -P flag for CL format contributes to producing just as ugly code as = what we have here. Code should never be used to create natural language = strings with syntactic expectation. Here is the example given in "Common Lisp the Language, 2nd Edition" (format nil "~D tr~:@P/~D win~:P" 7 1) =3D> "7 tries/1 win"=20 (format nil "~D tr~:@P/~D win~:P" 1 0) =3D> "1 try/0 wins"=20 (format nil "~D tr~:@P/~D win~:P" 1 3) =3D> "1 try/3 wins" How do you think that kind of strings can possibly be localized ? Jean-Christophe=20