220 13666 <da7dda72-2f19-4540-989e-93c1950910c6@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Myriachan <myriachan@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: constexpr ascii character checks
Date: Sat, 4 Oct 2014 13:41:23 -0700 (PDT)
Lines: 275
Approved: news@gmane.org
Message-ID: <da7dda72-2f19-4540-989e-93c1950910c6@isocpp.org>
References: <c9a50690-0464-43e5-8da7-e9a42e9c548a@isocpp.org> <1623033.epud7EB2qf@tjmaciei-mobl4> <06ae16b5-9e0c-493f-8284-045c29f06a2e@isocpp.org>
 <1823892.IarJFYWuo6@tjmaciei-mobl4>
 <d7b9e872-0300-4296-a581-eb8564215377@isocpp.org>
 <abce7413-ed8e-41df-a64b-b8d8f318569c@isocpp.org>
 <ae230d55-7e3a-44e5-aa12-6ef5fc72cc1b@isocpp.org>
 <cdfa7a7e-de0e-469b-bf29-fa1088fe9fc4@isocpp.org>
 <d776ee57-5a3a-484c-b815-1cef588a8313@isocpp.org>
 <17964583-7098-4236-9802-eb66fa327d58@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_292_1825509262.1412455283761"
X-Trace: ger.gmane.org 1412455298 3207 80.91.229.3 (4 Oct 2014 20:41:38 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 4 Oct 2014 20:41:38 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDKLT4PURQHRB5NWYGQQKGQENODGQ2I@isocpp.org Sat Oct 04 22:41:32 2014
Return-path: <std-proposals+bncBDKLT4PURQHRB5NWYGQQKGQENODGQ2I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pd0-f198.google.com ([209.85.192.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDKLT4PURQHRB5NWYGQQKGQENODGQ2I@isocpp.org>)
	id 1XaW8t-0007fk-NA
	for gclcip-std-proposals@m.gmane.org; Sat, 04 Oct 2014 22:41:28 +0200
Original-Received: by mail-pd0-f198.google.com with SMTP id v10sf10106828pde.1
        for <gclcip-std-proposals@m.gmane.org>; Sat, 04 Oct 2014 13:41:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=glIgsQuUDfmQEUVpj9ZevhAYcWeklmh6aRzYGMiBNXk=;
        b=tIP0y4Q5LbHZexoz8TN1Zib6D49huasJ7hVSvJv2aXBhqdTIbbOI6JvY2uQgzFeL/H
         wBy6AlRLAH30xiRPsxNflhe1XQ/DtcK88GbPXOnTmEfsr8HdBtEnnCqfsAQPAGojb0D0
         4QLCIX2+jrI0lho63ZDiSsvIej6zkSjOO4yqEUWZQaJyNm8Amq8pRb/5xfNsbYgkiVd5
         gw7U+AmLhj4GCnMNsrCk0IeqLZ8+cX2VPQbH5ZY0ly2DFTZnhp+qIuuFVAMTEbcle+qs
         UYJFMbx17Conjb1jU3HJYejntfOz8nMubxFkTiISeN/NKYoGw+OaMeqP4izZQEswCge8
         t4GQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=glIgsQuUDfmQEUVpj9ZevhAYcWeklmh6aRzYGMiBNXk=;
        b=DcnvefRvUUxcYGoDXqJhInV1pdUL+GDe0JEauVgi+w/ZRVvjrL16jG38wOe6IASCmJ
         Al7izfvju1eZaF5axPFHSOM4QVseVtc4h+zoGiVdobzMkaWUsguFFf2TFE372HvI6lqx
         L9oproSKZMM406cJKjS4JskY1LzWd2goQ5aFAY4Fx9vJVdzX7v9b94SZX6JmmsSqD4tH
         ZGUxUKPPn25VdOuIDZzJCOUmlFPiKp+rnZxYG+ojpHcq+D9k0z5WskLim5gOBgPUPpE0
         2PpI5+Ie54ttjj7pXogzpg4UeSS49oHz5FD66LPABSQ5NkVVgM75rmQwIzZb6Py9fx8C
         y9Qw==
X-Gm-Message-State: ALoCoQmBavLQeDpU6ZwMQ3vRr1P5vmnit48b0ECixvXpQYkNcr0nGKRFygQeixdwLClNHK0f4iM1
X-Received: by 10.66.227.71 with SMTP id ry7mr9635095pac.13.1412455286458;
        Sat, 04 Oct 2014 13:41:26 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.13.4 with SMTP id d4ls1652929igc.19.canary; Sat, 04 Oct
 2014 13:41:25 -0700 (PDT)
X-Received: by 10.50.43.167 with SMTP id x7mr26407igl.3.1412455285802;
        Sat, 04 Oct 2014 13:41:25 -0700 (PDT)
In-Reply-To: <17964583-7098-4236-9802-eb66fa327d58@isocpp.org>
X-Original-Sender: myriachan@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:13666
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/13666>

------=_Part_292_1825509262.1412455283761
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thursday, October 2, 2014 7:57:40 PM UTC-7, Matthew Fioravante wrote:
>
> On Thursday, October 2, 2014 10:50:28 PM UTC-4, ron novy wrote:
>>
>> I might be misunderstanding its function, but the isascii(int) function=
=20
>> might give invalid results as implemented.  It returns false for a null=
=20
>> character and true if any of the first 7 bits are set.  This does not ma=
tch=20
>> the description of the function where it returns true if the value passe=
d=20
>> is >=3D 0 and <=3D 0x7F.
>>
>
> That's a bug in my example header. Fixed
>

Regarding the undefined nature of todigit with bad input characters, do you=
=20
mean that it's acceptable for these functions to crash if you give them a=
=20
bad character, or that they merely give some weird useless result instead? =
=20
The latter would be called "unspecified" instead.

Wasn't there previously a fromdigit?  Also, what you have now as todigit=20
seems more like a fromdigit than a todigit, because it just passed an=20
isdigit check...

General proposal note: "ASCII" is an acronym--American Standard Code for=20
Information Interchange--and, as such, should be written in all caps in the=
=20
proposal.  Note that I'm not saying that this applies to identifier names=
=20
like std::ascii, std::isascii, etc; those should remain lowercase.


No need to mention Microsoft Excel; "any common spreadsheet application"=20
would work, because that is true.  Any common spreadsheet can export .csv=
=20
files.  Heck, my database query tool can export select results as .tsv or=
=20
..csv.


Typo in proposal's prototypes:

constexpr bool std::ascii:isalnum(char16_t c) noexcept;
constexpr bool std::ascii:isalnum(char32_t c) noexcept;

*Return*: std::ascii::isalpha(c) || std::asci::isdigit(c)

Needs two colons before isalnum.  This one is systemic of the Character=20
Checks part.  isalnum specifically has a typo where asci should be ascii.

constexpr int todigit(char c, int m) noexcept;
constexpr int todigit(wchar_t c, int m) noexcept;
constexpr int todigit(char16_t c, int m) noexcept;
constexpr int todigit(char32_t c, int m) noexcept;

*Return*: std::ascii::todigit(c) * m

I think that you intended these to say std::ascii:: before todigit.

*Return*: (c >=3D 33 && c<=3D 126)

Space after second c.


Words that should be in monospace font:

"This proposal adds a set of //constexpr// free functions"


Phrases that need hyphens:

digit-to-int
high-performance
error-prone
ASCII-compatible
char-to-int
platform-agnostic
platform-specific
user-defined
std-proposals (because that's the name of this list)

Typos / misspellings:

Change: ~large data files which use ascii delimeters.
To: ~ASCII delimiters.

Change: ~github.
To: ~GitHub.

Change: We propose 2 additional useful functions todigit, and toxdigit.
To: ~functions: todigit and toxdigit.  (Add colon, remove comma.  Oxford=20
command is awkward with two items.)

Change: 2
To: two    (this is a generic change to make things more readable)

Change: Alternatively, all of these defintions
To: Alternatively, all these definitions   (delete "of', fix spelling of=20
"definitions")

Change: Each function has overloads for type char, wchar_t, char16_t, and=
=20
char32_t.
To: (Delete final comma.  This is stylistic, though, and definitely up to=
=20
you, of course.)

Change:=20
*[note-- All of these~*To: [*Note:* All these~     (If you want to follow=
=20
the Standard's formatting, it's non-italic [ followed by italic *Note:* and=
=20
non-italic note text.  Delete "of".)

Change:=20
*locale settings. --end-note]*To: locale settings. =E2=80=94*end note*] =20
(Similarly, this is an "em-dash" (U+002014), "end note" in italic (no=20
hyphen between "end" and "note") and a non-italic ] )

Change: *Return:*
To: *Returns:*

Change: On systems such as windows
To: On systems such as Windows

Change: where wchar_t happens to be using an ASCII-compatible encoding
To: where wchar_t happens to be using an ASCII-compatible encoding (UTF-16)

Change: presense
To: presence

Change: standard committee
To: Standard Committee

Change: Csv file parsers
To: .csv file parsers  or   CSV file parsers

Change: decide that wchar_t is a bad idea
To: decide that wchar_t support in this proposal is a bad idea

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_292_1825509262.1412455283761
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Thursday, October 2, 2014 7:57:40 PM UTC-7, Matthew Fio=
ravante wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"=
>On Thursday, October 2, 2014 10:50:28 PM UTC-4, ron novy wrote:<blockquote=
 class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px =
#ccc solid;padding-left:1ex"><div dir=3D"ltr">I might be misunderstanding i=
ts function, but the isascii(int) function might give invalid results as im=
plemented. &nbsp;It returns false for a null character and true if any of t=
he first 7 bits are set. &nbsp;This does not match the description of the f=
unction where it returns true if the value passed is &gt;=3D 0 and &lt;=3D =
0x7F.</div></blockquote><div><br></div><div>That's a bug in my example head=
er. Fixed</div></div></blockquote><div><br>Regarding the undefined nature o=
f <span style=3D"font-family: courier new,monospace;">todigit</span> with b=
ad input characters, do you mean that it's acceptable for these functions t=
o crash if you give them a bad character, or that they merely give some wei=
rd useless result instead?&nbsp; The latter would be called "unspecified" i=
nstead.<br><br>Wasn't there previously a <span style=3D"font-family: courie=
r new,monospace;">fromdigit</span>?&nbsp; Also, what you have now as <span =
style=3D"font-family: courier new,monospace;">todigit</span> seems more lik=
e a <span style=3D"font-family: courier new,monospace;">fromdigit</span> th=
an a <span style=3D"font-family: courier new,monospace;">todigit</span>, be=
cause it just passed an <span style=3D"font-family: courier new,monospace;"=
>isdigit</span> check...<br><br>General proposal note: "ASCII" is an acrony=
m--American Standard Code for Information Interchange--and, as such, should=
 be written in all caps in the proposal.&nbsp; Note that I'm not saying tha=
t this applies to identifier names like <span style=3D"font-family: courier=
 new,monospace;">std::ascii</span>, <span style=3D"font-family: courier new=
,monospace;">std::isascii</span>, etc; those should remain lowercase.<br><b=
r><br>No need to mention Microsoft Excel; "any common spreadsheet applicati=
on" would work, because that is true.&nbsp; Any common spreadsheet can expo=
rt .csv files.&nbsp; Heck, my database query tool can export select results=
 as .tsv or .csv.<br><br><br>Typo in proposal's prototypes:<br><br><pre><co=
de>constexpr bool std::ascii<span style=3D"color: rgb(255, 0, 0);">:</span>=
isalnum(char16_t c) noexcept;
constexpr bool std::ascii<span style=3D"color: rgb(255, 0, 0);">:</span>isa=
lnum(char32_t c) noexcept;
</code></pre>

<p><strong>Return</strong>: <code>std::ascii::isalpha(c) || std::<span styl=
e=3D"color: rgb(255, 0, 0);">asci</span>::isdigit(c)</code></p><p>Needs two=
 colons before <span style=3D"font-family: courier new,monospace;">isalnum<=
/span>.&nbsp; This one is systemic of the Character Checks part.&nbsp; <spa=
n style=3D"font-family: courier new,monospace;">isalnum</span> specifically=
 has a typo where <span style=3D"font-family: courier new,monospace;">asci<=
/span> should be <span style=3D"font-family: courier new,monospace;">ascii<=
/span>.</p><pre><code>constexpr int todigit(char c, int m) noexcept;
constexpr int todigit(wchar_t c, int m) noexcept;
constexpr int todigit(char16_t c, int m) noexcept;
constexpr int todigit(char32_t c, int m) noexcept;
</code></pre>

<p><strong>Return</strong>: <code>std::ascii::todigit(c) * m</code></p><p>I=
 think that you intended these to say <span style=3D"font-family: courier n=
ew,monospace;">std::ascii::</span> before <span style=3D"font-family: couri=
er new,monospace;">todigit</span>.<br></p><p><strong>Return</strong>: <code=
>(c &gt;=3D 33 &amp;&amp; c<span style=3D"color: rgb(255, 0, 0);">&lt;=3D</=
span> 126)</code></p><p>Space after second <span style=3D"font-family: cour=
ier new,monospace;">c</span>.</p><p><br></p><p>Words that should be in mono=
space font:</p><p>"This proposal adds a set of //constexpr// free functions=
"</p><p><br></p><p>Phrases that need hyphens:</p><p>digit-to-int<br>high-pe=
rformance<br>error-prone<br>ASCII-compatible<br>char-to-int<br>platform-agn=
ostic<br>platform-specific<br>user-defined<br>std-proposals (because that's=
 the name of this list)<br><br></p><p>Typos / misspellings:<br><br>Change: =
~large data files which use ascii delimeters.<br>To: ~ASCII delimiters.</p>=
<p>Change: ~github.<br>To: ~GitHub.</p><p>Change: We propose 2 additional u=
seful functions todigit, and toxdigit.<br>To: ~functions: todigit and toxdi=
git.&nbsp; (Add colon, remove comma.&nbsp; Oxford command is awkward with t=
wo items.)<br></p><p>Change: 2<br>To: two&nbsp;&nbsp;&nbsp; (this is a gene=
ric change to make things more readable)</p><p>Change: Alternatively, all o=
f these defintions<br>To: Alternatively, all these definitions&nbsp;&nbsp; =
(delete "of', fix spelling of "definitions")</p><p>Change: Each function ha=
s overloads for type <code>char</code>, <code>wchar_t</code>, <code>char16_=
t</code>, and <code>char32_t</code>.<br>To: (Delete final comma.&nbsp; This=
 is stylistic, though, and definitely up to you, of course.)</p><p>Change: =
<em>[note-- All of these~<br></em>To: [<i>Note:</i> All these~ &nbsp;&nbsp;=
&nbsp; (If you want to follow the Standard's formatting, it's non-italic [ =
followed by italic <i>Note:</i> and non-italic note text.&nbsp; Delete "of"=
..)</p><p>Change: <em>locale settings. --end-note]<br></em>To: locale settin=
gs. =E2=80=94<i>end note</i>]&nbsp; (Similarly, this is an "em-dash" (U+002=
014), "end note" in italic (no hyphen between "end" and "note") and a non-i=
talic ] )</p><p>Change: <b>Return:</b><br>To: <b>Returns:</b></p><p>Change:=
 On systems such as windows<br>To: On systems such as Windows</p><p>Change:=
 where <span style=3D"font-family: courier new,monospace;">wchar_t</span> h=
appens to be using an ASCII-compatible encoding<br>To: where <span style=3D=
"font-family: courier new,monospace;">wchar_t</span> happens to be using an=
 ASCII-compatible encoding (UTF-16)</p><p>Change: presense<br>To: presence<=
/p><p>Change: standard committee<br>To: Standard Committee</p><p>Change: Cs=
v file parsers<br>To: .csv file parsers&nbsp; or&nbsp;&nbsp; CSV file parse=
rs</p><p>Change: decide that <code>wchar_t</code> is a bad idea<br>To: deci=
de that <code>wchar_t</code> support in this proposal is a bad idea</p></di=
v></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_292_1825509262.1412455283761--

.
