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.204.157.134 with SMTP id b6mr432643bkx.5.1339697388843; Thu, 14 Jun 2012 11:09:48 -0700 (PDT) Path: e27ni48168bkw.0!nntp.google.com!news1.google.com!news2.google.com!goblin1!goblin2!goblin.stu.neva.ru!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 20:38:59 +0200 Organization: cbb software GmbH Message-ID: <1crzx65j543zy.1ptlx1vf7esmq.dlg@40tude.net> References: <1c82b5mc3waww.1t6q6vj61u36u.dlg@40tude.net> <42a87cf3ce9bfd6054f78b2b5b356301@dizum.com> <4fd60053$0$9510$9b4e6d93@newsspool1.arcor-online.net> <4fd62785$0$9518$9b4e6d93@newsspool1.arcor-online.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 4RFYTQ6jM/dAKFJoI0fUkg.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-11T20:38:59+02:00 List-Id: On Mon, 11 Jun 2012 19:14:45 +0200, Georg Bauhaus wrote: > On 11.06.12 16:43, Dmitry A. Kazakov wrote: >> On Mon, 11 Jun 2012 16:27:30 +0200, Georg Bauhaus wrote: >> >>> On 11.06.12 10:22, Dmitry A. Kazakov wrote: >>>> 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. >>> >>> In case there is no arithmetic of code points, it is really >>> surprising to see >>> >>> type Code_Point is mod 2**32; >>> >>> and not >>> >>> type Code_Point is private; >> >> Code points are numeric: > > Numeric to what extent? In the sense that there exists a bijection code point <-> number. > I'd have thought that code points need little more > than equality and ordering, with conversion functions to/from a "more" > numeric type such as mod 2**32 or a range type. Either for construction > of code point values, or in case an algorithm wants to use offsets, > or use a table indexed by a numeric subtype made from a "subsection" of > the repertoire. > > The construction function could be nicely Unicode-ish when named U: > > PI : constant Code_Point := U+16#03C0#; Funny, but U+number is a notation for a language lacking proper numeric types. Why not to use just number if the language allows that? BTW, as practice shows, code points are used rarely and almost always as an argument for conversion to a UTF-8 string. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de