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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA 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.141.4 with SMTP id k4mr430363bku.6.1339696962474; Thu, 14 Jun 2012 11:02:42 -0700 (PDT) Path: e27ni48157bkw.0!nntp.google.com!news1.google.com!news4.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!212.27.60.9.MISMATCH!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 11 Jun 2012 19:14:45 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Practicalities of Ada for app development References: <1c82b5mc3waww.1t6q6vj61u36u.dlg@40tude.net> <42a87cf3ce9bfd6054f78b2b5b356301@dizum.com> <4fd60053$0$9510$9b4e6d93@newsspool1.arcor-online.net> In-Reply-To: Message-ID: <4fd62785$0$9518$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 11 Jun 2012 19:14:45 CEST NNTP-Posting-Host: e412e7e9.newsspool1.arcor-online.net X-Trace: DXC=Z2_[X6^iRTJ@Y=h<_c3PkHic==]BZ:afN4Fo<]lROoRAnkgeX?EC@@@RXf;QenT\CMnc\616M64>JLh>_cHTX3jMOhlARSba4:C X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2012-06-11T19:14:45+02:00 List-Id: 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? 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#; > http://en.wikipedia.org/wiki/Unicode package Unicode_Stuff is Data_Error : exception; type Unsigned is mod 2**32; type Code_Point is private; Max_Code_Point : constant := 16#10FFFF#; type Non_Code_Point(<>) is limited private; U : constant Non_Code_Point; function "+" (U : in Non_Code_Point; Number : in Unsigned) return Code_Point; -- raises Data_Error if Number > Max_Code_Point; private type Code_Point is new Unsigned range 0 .. Max_Code_Point; type Non_Code_Point is limited null record; U : constant Non_Code_Point := (null record); end Unicode_Stuff;