Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83153 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38046 invoked from network); 19 Feb 2015 07:46:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2015 07:46:26 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.220.53 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.220.53 mail-pa0-f53.google.com Received: from [209.85.220.53] ([209.85.220.53:39520] helo=mail-pa0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/42-22021-0D495E45 for ; Thu, 19 Feb 2015 02:46:25 -0500 Received: by pablf10 with SMTP id lf10so7597793pab.6 for ; Wed, 18 Feb 2015 23:46:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=KUUmiWDlePyFnmDiNGSK6s77+ZSE5l4CQsrhDBePB5g=; b=JLOUUxcV8yXRDXpn3QuMyIOoJYa9tYGE4+fgp6Wutkunfko5J/8l6WpZP30YqqS8/R KwPRTZ9ABSiq8ywZN/3mz51IsQUILyW5UGQVlkOonqU+ole6nudbXaAltWt58gYwonnT PVKSxvIdzY/kKVDPQTsgOzPLUeXVgybTDh3k1TvFeuwXlzD4KRRxVyC4nwlR/KlJpi3q 7VRwNcz6lHYlTFLb/6FommFMASsu67LsUPf1EYd/zVsYPfVuPXkkA3udlRJ0uPz8gGRr PEwYRm2BaeskDhBlBQ1dY4PVLJ92tW8t82KmnS4q3wybifWVLggsUGeacpQM3rjppbAE FnPg== X-Gm-Message-State: ALoCoQk1Ay62y+x5HSjTjNMvn4IiLs33JdAzdoJoalTl9KG7/o/Xq/9/jzUMqE2dSSwqk4drg4Xi X-Received: by 10.68.190.101 with SMTP id gp5mr5721234pbc.30.1424331981049; Wed, 18 Feb 2015 23:46:21 -0800 (PST) Received: from [192.168.200.14] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPSA id hs13sm23041359pac.48.2015.02.18.23.46.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 23:46:19 -0800 (PST) Message-ID: <54E594CA.5010200@lerdorf.com> Date: Wed, 18 Feb 2015 23:46:18 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Rick Widmer , internals@lists.php.net References: <54E5456E.4020103@gmx.de> <54E54E1E.1010906@lerdorf.com> <54E58F06.1040707@developersdesk.com> In-Reply-To: <54E58F06.1040707@developersdesk.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2XCkDAdERmagk61cOfBKj7XcRswLaSGnp" Subject: Re: [PHP-DEV] Digit separators for numeric literals From: rasmus@lerdorf.com (Rasmus Lerdorf) --2XCkDAdERmagk61cOfBKj7XcRswLaSGnp Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/18/2015 11:21 PM, Rick Widmer wrote: > On 2/18/2015 7:44 PM, Rasmus Lerdorf wrote: >> Now if we went into Unicode territory, we could do it. eg. >> >> my_func(1=E1=9A=80999=E1=9A=80999) U+1680 (although it looks too mu= ch like a -) >> my_func(1=E2=81=9F999=E2=81=9F999) U+205F (mathematical space) >> my_func(1=D9=AC999=D9=AC999) U+066C (Arabic thousands separator) >> my_func(1=C2=B7999=C2=B7999) U+00B7 (middle dot) >> >> The last one looks best to me, but we'd need a team of people working = in >> shifts to answer the, "How do I type this?" question. >> >> -Rasmus >=20 > how about: >=20 > my_func( '1,000.04' ); //if you want to use separators there. The problem with that is that the world is split. The other half, or actually more than half, would write that as '1.000,04'. There is no way we would want to take sides on that one. And we have support for locale-based number formatting and parsing via numfmt_format() and numfmt_parse(). If we were going to add a separator for literals, the only real low-ascii choice is _ which is also used by Ada, D, Java, Perl and Ruby. I was 90% kidding about using a Unicode character, but if you think about it a bit, most people are using IDEs or at least smart scriptable editors, it wouldn't be that much of a stretch to picture your editor pretty-printing 1234567890 as 1=C2=B7234=C2=B7567=C2=B7890 or 1=CB=99234=CB= =99567=CB=99890 (U+02D9). It would be easy to make the parser ignore that character in numeric literals. Much easier than working out the various issues with _ anyway. Although, personally it would freak me out if my editor started messing with my numbers on me. But I don't use an IDE. I don't even have syntax-highlighting turned on in my vim config. We didn't have stuff like that on the Wyse 50. -Rasmus --2XCkDAdERmagk61cOfBKj7XcRswLaSGnp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTllMoACgkQlxayKTuqOuBZjwCeL3PbmuT/HAvK0iNWzZ46GLVx 1sUAn2Q9hFDfM5EIBmMwNZ/atsnaib5H =ajQj -----END PGP SIGNATURE----- --2XCkDAdERmagk61cOfBKj7XcRswLaSGnp--