• c++ language spec feature request

    From Jim Michaels@21:1/5 to All on Sat Apr 23 07:01:08 2016
    { 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! ]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Bonner@21:1/5 to Jim Michaels on Sun Apr 24 07:17:07 2016
    On Saturday, 23 April 2016 14:10:18 UTC+2, Jim Michaels wrote:
    std::string needs:
    * 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! ]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Cholo Lennon@21:1/5 to Martin Bonner on Mon Apr 25 13:01:36 2016
    On 04/24/2016 10:17 AM, Martin Bonner wrote:
    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! ]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wouter van Ooijen@21:1/5 to All on Sun Apr 24 12:05:06 2016
    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.

    std::string needs:
    (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?

    c++ needs:
    * 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! ]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Bonner@21:1/5 to Cholo Lennon on Tue Apr 26 09:20:19 2016
    On Monday, 25 April 2016 20:10:10 UTC+2, Cholo Lennon wrote:
    On 04/24/2016 10:17 AM, Martin Bonner wrote:
    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

    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! ]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Cholo Lennon@21:1/5 to Martin Bonner on Wed Apr 27 06:45:26 2016
    On 04/26/2016 12:20 PM, Martin Bonner wrote:

    On Monday, 25 April 2016 20:10:10 UTC+2, Cholo Lennon wrote:
    On 04/24/2016 10:17 AM, Martin Bonner wrote:
    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

    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)


    (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! ]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?ISO-8859-1?Q?=D6=F6_Tiib?=@21:1/5 to Richard on Wed Apr 27 08:43:05 2016
    On Tuesday, 26 April 2016 21:40:09 UTC+3, Richard wrote:
    Jim Michaels <jmichae3@this.is.invalid> spake the secret code <db8a24bc-a8cc-4827-8bf9-783251a0a112@googlegroups.com> thusly:

    [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.)

    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! ]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard@21:1/5 to All on Tue Apr 26 13:32:06 2016
    [Please do not mail me a copy of your followup]

    Jim Michaels <jmichae3@this.is.invalid> spake the secret code <db8a24bc-a8cc-4827-8bf9-783251a0a112@googlegroups.com> thusly:

    [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! ]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)