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,9a4a0b8e5206a866 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Conversion of Access Types Question Date: 1999/01/20 Message-ID: #1/1 X-Deja-AN: 434868328 Sender: matt@mheaney.ni.net References: <369DFFFC.A160D47C@neta.com> <77l492$b5s@hobbes.crc.com> <77ma9b$6ep$1@nnrp1.dejanews.com> NNTP-Posting-Date: Wed, 20 Jan 1999 09:07:12 PDT Newsgroups: comp.lang.ada Date: 1999-01-20T00:00:00+00:00 List-Id: Robert A Duff writes: > dewar@gnat.com writes: > > > This is a very common misunderstanding in Ada 95, which is > > why we recently added the second message, since it is > > almost certain to be the right fix. Some Ada 95 programmers > > simply make a rule of using "ALL" for all access types. > > In retrospect, I think the distinction between the two kinds of access > types (with and without "all") is not useful enough to have in the > language. It's a little bit useful, but as you can see, it causes > confusion. It would have been better to simply make all access types > behave like the "all" kind, and get rid of the "all" syntax. > > That's what Tucker wanted to do in the first place, by the way. > He was convinced otherwise, partly by me. :-( That's what you said back on 1996/05/24 too: (start of old post) Re: Type conversion between access types (was: Free'ing extended types) In article , Scott Leschke wrote: >I have noticed that in most of the code I've seen, all is used pretty >liberally would makes me wonder about the benefit of making the >distinction between pool and general accesss types myself. I have >wondered if it may have been better to have the distinction go the >other way if indeed a distinction was warranted (ie. general and >non-pool based). I admit, with 20-20 hindsight, that the 'all' thing was a mistake. I pushed for the idea during the design of Ada 9X, because I thought this efficiency distinction was important. Tucker, on the other hand, thought that all access types should be 'all'. He was right; I was wrong. (end of old post) I completely agree; I just use general access types everywhere. It's been my experience that in practice, when writing abstractions that have flexible memory management schemes, you end up having to declare all the access types to be general access types anyway. So why make the distinction? And think about the inconsistency with access parameters: you don't make the distinction there. Worse, there is no "access constant" parameter, which we really do need. (Now, without access constant parameters, we have to resort to back-door hacks using an in param instead, thus losing the scope-checks that the compiler would otherwise provide.) And for what benefit was the distinction between general and pool-specific access types made? I think, to be able to have a different representation for pool-specific types. But, are there any compilers that actually do have a different representation? Couldn't there have been another way to enable this alternate representation, such as a pragma? Adding "access all T" to the language complicates the language, adds syntactic overhead, and makes this aspect of the language much harder to learn and teach. Matt