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: a07f3367d7,d5b211b0c1ffcf3e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.205.134.138 with SMTP id ic10mr408352bkc.8.1339694285453; Thu, 14 Jun 2012 10:18:05 -0700 (PDT) Path: e27ni48017bkw.0!nntp.google.com!news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Practicalities of Ada for app development Date: Mon, 11 Jun 2012 10:22:35 +0200 Organization: cbb software GmbH Message-ID: References: <1c82b5mc3waww.1t6q6vj61u36u.dlg@40tude.net> <42a87cf3ce9bfd6054f78b2b5b356301@dizum.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-06-11T10:22:35+02:00 List-Id: On Sun, 10 Jun 2012 23:36:46 +0200 (CEST), Nomen Nescio wrote: > "Dmitry A. Kazakov" wrote: >> >>> Please, why have you defined Code_Point as a modular type? >> >> Because code point is unsigned. When you declare something signed >> you do that because you want negative inverses. Signed integers have >> the base type with 0 in the middle of its range. > > That's no reason to use mod. You can put boundaries where you want > them, integer, or mod. > > It's about the operators. Exactly, there is *no* arithmetic of code points. Code point is an enumeration. The modulo ring operations with code points are less meaningless than bounded integer arithmetic is. You better don't add code points at all. Implementation per modular type has performance advantages, so I chose it. I considered Wide_Wide_Character instead, but dropped that idea because it would lack numeric literals common for Unicode. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de