From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 109fba,cd8ed9115942852f X-Google-NewGroupId: yes X-Google-Thread: 103376,b92b95c9b5585075 X-Google-NewGroupId: yes X-Google-Attributes: gid4f1905883f,gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news-transit.tcx.org.uk!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.c++,comp.lang.ada Subject: Re: Why use C++? Date: Fri, 12 Aug 2011 11:40:58 +0200 Organization: cbb software GmbH Message-ID: <27gqrnht5c9d$.1trzrissr4mjn.dlg@40tude.net> References: <1e292299-2cbe-4443-86f3-b19b8af50fff@c29g2000yqd.googlegroups.com> <1fd0cc9b-859d-428e-b68a-11e34de84225@gz10g2000vbb.googlegroups.com> <9ag33sFmuaU1@mid.individual.net> <1d8wyhvpcmpkd.ggiui9vebmtl.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: niB90GgZAl6XBQ7TPPIU4Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.c++:92606 comp.lang.ada:21534 Date: 2011-08-12T11:40:58+02:00 List-Id: On Fri, 12 Aug 2011 00:02:55 -0500, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:1d8wyhvpcmpkd.ggiui9vebmtl.dlg@40tude.net... >> As for modular types, wrapping is the mathematically correct behavior, it >> is not an error. > > Right, but using modular types as a stand-in for unsigned integers doesn't > really work. I never felt much need in unsigned integers, except when communicating with hardware. But then the behavior upon overflow is either irrelevant or better be wrapping. > Syntactically, Ada ought to have a way to declare an overflow-checked > integer type without any restriction to signed/unsigned representations. Maybe, however that should not be limited to unsigned integers. If you, as an influential ARG member, are going to change something (:-)), then, please, consider more general shifted integer types: type Shifted range 100..200; for Shifted'First use 0; -- The first value is 100. (Of course there should be better syntax here) >> You just cannot provide every possible arithmetic at the language level. > > No, you should have a single general integer type (with no reflection on > "bits" or "signs"). The rest should be modeled as libraries. (I think we > actually agree on this -- must be something in the water today. ;-) As the result of so called "global warming" we have no summer third year in a row. Much, much cold water... (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de