Discussion:
c++ language spec feature request
(too old to reply)
Jim Michaels
2016-04-23 13:01:08 UTC
Permalink
{ edited by mod to shorten lines to ~70 characters. -mod }

C doesn't support any default arguments, and that's unlikely to change.
if it did, people would be very very happy - I wonder what its effect
on DLLs would be

std::string needs:
* the complete string.h library included
* std::string::operator==(), std::string::operator!=,
std::string::operator-() (diff)
* optimized-for-speed compare() that includes arg for ignore case.
I have such a function and it's for sale by God.
* std::string::toLower(), std::string::toUpper()
* std::string::trim(), std::string::trimLeft(), std::string::trimRight()
* std::string::removeWhitespace()
* std::vector<std::string> std::string::split(std::string s)
* std::string std::string::join(std::vector<std::string> vs,
std::string sJoinWith)
* rename std::utf8string to std::u8string.
* support for easy conversions between std::string types (u32, u16,
u8, w, char)
* change base for std::string to use unsigned char rather than signed.
otherwise you get negative numbers for chars outside the ASCII range.



cstring needs:
the complete string.h library included (why wasn't it? people expect
that)

c++ needs:
* ||=, &&= to C++ and C
* all of math.h in cmath
* BigInt, BigNum, BigFloat math and data types.
* support for 128-bit integer such as uint128_t, int128_t for example.
I currently have a need for this for time calculations. uint256_t,
int256_t would be even nicer.


please. thanks in advance.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Martin Bonner
2016-04-24 13:17:07 UTC
Permalink
Post by Jim Michaels
* std::string::toLower(), std::string::toUpper()
I asssume these will respect locale. If not, they are completely broken
in Turkish where the uppercase form of "i" is "İ", not "I" (which
corresponds to "ı").

As an aside, they will be called to_lower and to_upper if adopted (the C++
library doesn't use camelCase.)

What is the output, in the German locale, of the following code?
std::string s{"MASSE"};
s.to_lower();
std::cout << s << std::endl;

In general converting "SS" to lower case in German requires a dictionary to
decide whether they should become "ss" or "ß". Such a dictionary could be
built into the library (although it is a large demand on the library). The
trouble with "MASSE" is that depending on context, it could either be
"masse" or "maße" - so you don't just need a dictionary, you need a natural
language parser.

The need for a dictionary is not exclusive to German. Spanish (in at least
some forms) drop accents on upper-case, so you need a dictionary to put them
back again.

Basically, as soon as you step outside English, text processing becomes
*amazingly* much harder than you think.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Cholo Lennon
2016-04-25 19:01:36 UTC
Permalink
Post by Martin Bonner
Spanish (in at least
some forms) drop accents on upper-case, so you need a dictionary to put them
back again.
Accents on upper-case are *mandatory* in Spanish. Some people get rid of
them them, but that is incorrect. More information here (in Spanish):

http://www.rae.es/consultas/tilde-en-las-mayusculas

Best regards
--
Cholo Lennon
Bs.As.
ARG


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Martin Bonner
2016-04-26 15:20:19 UTC
Permalink
Post by Cholo Lennon
Spanish (in at least some forms) drop accents on upper-case, so you
need a dictionary to put them back again.
Accents on upper-case are *mandatory* in Spanish. Some people get rid of
http://www.rae.es/consultas/tilde-en-las-mayusculas
My information is more than 20 years out of date, and came from an educated
Argentinian. Either "archiac" or "Argentinian" could explain the difference
- or he could just have been wrong.

(My main point stands though - upper/lower case is a whole heap of pain
once you start using languages other than English.)
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Cholo Lennon
2016-04-27 12:45:26 UTC
Permalink
Post by Martin Bonner
Post by Cholo Lennon
Spanish (in at least some forms) drop accents on upper-case, so you
need a dictionary to put them back again.
Accents on upper-case are *mandatory* in Spanish. Some people get rid of
http://www.rae.es/consultas/tilde-en-las-mayusculas
My information is more than 20 years out of date, and came from an educated
Argentinian. Either "archiac" or "Argentinian" could explain the difference
- or he could just have been wrong.
The problem was (at least in Argentina) that a lot of primary school
teachers used to say that you can omit the accents when writing with
upper-case letters. I don't know why they said that. I heard the idea
came from the fact that old writing machines hadn't support for
upper-case accents (that's why people got used to write without them)
Post by Martin Bonner
(My main point stands though - upper/lower case is a whole heap of pain
once you start using languages other than English.)
Of course, that's a real problem, you're right :-)

Best regards
--
Cholo Lennon
Bs.As.
ARG




[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Wouter van Ooijen
2016-04-24 18:05:06 UTC
Permalink
Post by Jim Michaels
C doesn't support any default arguments, and that's unlikely to change.
if it did, people would be very very happy - I wonder what its effect
on DLLs would be
Default argument values in C++ are purely a caller-side issue. I don't
see any (bad) interaction with DLLs.
(snip)

What do you think to achieve by post this list? Language (or in this
case, library-) changes require effort, careful work, and an enduring
commitment. Think 'a few years' of elapsed time, and a few man-month of
work (mythical or not) for let's say adding one of the string features
you want. Are you willing to do that?
Post by Jim Michaels
* support for 128-bit integer such as uint128_t, int128_t for example.
I currently have a need for this for time calculations. uint256_t,
int256_t would be even nicer.
Did you google to find any exiting implementations? Are they good enough

(implementation, tests and documentation)? If not, will you write your
own and submit such as a proposal?

Wouter "Objects? No Thanks" van Ooijen
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
legalize+ (Richard)
2016-04-26 19:32:06 UTC
Permalink
[Please do not mail me a copy of your followup]
[bunch of requested changes to the library/language]
Here's what you do. First, make a clone of this repository on github:
<https://github.com/cplusplus/draft>

Then edit the document to contain your proposed changes and use that
to make a proposal to the standards committee. You will probably need
to attend one or more meetings in person to defend and discuss your
proposal. If you convince enough of the community and standards body
to adopt your proposals, then you can probably make it into C++19.
(C++17 is pretty much feature complete at this point and it is
unlikely your changes are going to be even voted upon before C++17 is
ratified.)
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
The Terminals Wiki <http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Öö Tiib
2016-04-27 14:43:05 UTC
Permalink
Post by legalize+ (Richard)
[bunch of requested changes to the library/language]
<https://github.com/cplusplus/draft>
Then edit the document to contain your proposed changes and use that
to make a proposal to the standards committee. You will probably need
to attend one or more meetings in person to defend and discuss your
proposal. If you convince enough of the community and standards body
to adopt your proposals, then you can probably make it into C++19.
(C++17 is pretty much feature complete at this point and it is
unlikely your changes are going to be even voted upon before C++17 is
ratified.)
Doing like that would be IMHO naive and just waste time of OP
and everybody else whom he manages to get involved.

Library changes do not AFAIK become standardized without mature
working "existing art". Therefore OP should start by *implementing*
his ideas. For example in Boost String Algorithms Library
(http://www.boost.org/doc/libs/1_60_0/doc/html/string_algo.html).

In Boost community it is likely possible to find more experienced
advice and allies on that road than in low traffic Usenet group.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Loading...