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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,583275b6950bf4e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-22 00:27:17 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!dialin-145-254-039-249.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Quality systems (Was: Using Ada for device drivers? (Was: the Ada mandate, and why it collapsed and died)) Date: Thu, 22 May 2003 09:29:35 +0200 Organization: At home Message-ID: References: <9fa75d42.0305141747.5680c577@posting.google.com> <3ec4b1c9$1@news.wineasy.se> <9fa75d42.0305161748.1735fc32@posting.google.com> <4W%xa.28765$cK5.11964@nwrdny02.gnilink.net> <1053353256.804734@master.nyc.kbcfp.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-039-249.arcor-ip.net (145.254.39.249) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1053588435 30792937 145.254.39.249 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:37628 Date: 2003-05-22T09:29:35+02:00 List-Id: Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> Robert A Duff wrote: >> >> > The design team actually went back and forth several times between two >> > solutions: a kludgy "magic" package that supports unsigned types of >> > certain sizes, pretty much like C, and a first-class type with syntax >> > and relatively general semantics (including non-binary modulii). >> > I think perhaps the magic package was the better solution. >> >> What about: >> >> 1. arbitrary modulii without add, or, xor, not. > > By "add", you mean "and"? Yes of course. > Shrug. I don't like the whole concept of modular; I think it's more > readable to do the "mod" explicitly. Except perhaps for low-level cases > where you're mimicing hardware and the like. Modular types are still useful for cyclic buffers etc. BTW, it is strange that modular types are associated with unsigned numbers. In my view it would be more consistent to have: type X is mod range -2..4; > And I don't like the fact that in order to get one extra bit (e.g. a > range of 0..2**32-1 or 0..2**64-1) I have to use modular semantics, > in cases where I'm just counting things, so modular semantics is just > wrong. Yes, it should be a normal number, and also declared so: type X is range 0..2**(32-1); pragma Unsigned (X); or type X is unsigned range 0..2**(32-1); >> 2. predefined boolean array types with bit-wise and arithmetic >> operations, packed, allowed for discriminants etc. > > I would love to have discriminants whose type is array or record. > It's annoying to have to introduce pointers (and then make things > aliased) in order to pass an array as a parameter to a type. That's for sure. Discriminants of any type and for any type! type Dimensioned (SI : Unit) is ...; type Vector (SI : Unit) is array (...) of Dimensioned (SI); or even class-wide discriminated arrays: type X is tagged ...; type Class_Array (T : Tag) is array (...) of X (T); -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de