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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c1131ea1fcd630a X-Google-Attributes: gid103376,public From: Ken Garlington Subject: Re: To Initialise or not Date: 1996/05/13 Message-ID: <3197715D.55EE@lmtas.lmco.com>#1/1 X-Deja-AN: 154658522 references: <318508FE.204B@sanders.lockheed.com> <3196FBD9.6AA1@lmtas.lmco.com> <31975399.6F2C@lmtas.lmco.com> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Tactical Aircraft Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.01 (Macintosh; I; 68K) Date: 1996-05-13T00:00:00+00:00 List-Id: Robert A Duff wrote: > > But note that AI-51 has not yet been approved by the ARG. This AI was > considered at the November meeting, and I rewrote it to reflect my > understanding of the concensus. It will be considered again at the June > meeting, but the current (draft) version has no official status -- it's > just my personal opinion. Good point. However, for at least the two cases I agree with, I can't see the alternative, so I'm willing to accept that those will be approved. > Well, type Character uses all the bits up on most implementations, and > (in a packed array) Boolean uses up all the bits (namely 1 bit). Type > Integer uses up all the bits on most implementations. These aren't > things that you normally encapsulate in an "abstraction". Well, I (and Brian Wichmann) might disagree. More importantly, keep in mind that you want to extend the capabilities of the language. You should expect that you will have to do some things that "normally" aren't done. The real questions are: 1. Does the language give you the building blocks to do what you want, with reasonable efficiency and reliability? I think the answer here is "yes," based on my experience with GADTs and ADTs. 2. Does the language let you readily assemble these building blocks, and use them effectively? I'll accept that not everyone likes using a lot of ADTs. However, I think that the power of generics (and maybe controlled types?) certainly makes it easier to add uninit checks to Ada than to applications coded in most other languages. Nonetheless, you should agree that, if we limit the use of this technique to the class of objects (Pointers) we were discussing initially, a GADT is going to be much more readable, reliable, and modifiable (e.g converting between accesses and integers) than your coding standard, and with almost no additional source code. In fact, if your coding standard requires the declaration of No_Particular... for each type, the number of source lines may be _less_ (assuming you count each instantiation as one source line vs. two source lines for each access type using your coding standard). So, I'm still back to the core issue. Why do the explicit intialization to the literal "null", when there's much more effective approaches to solving your pointer problems for almost no additional cost (and maybe less cost)? > > - Bob -- LMTAS - "Our Brand Means Quality"