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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c76d41708bf94f23 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: c2ada bug report filed Date: Fri, 01 Apr 2011 07:38:23 +0100 Organization: A noiseless patient Spider Message-ID: References: <3a657bf9-89ed-45c8-bd4d-f226cb3bc5fa@w7g2000pre.googlegroups.com> <4d94c18b$0$4966$a8266bb1@postbox2.readnews.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx01.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="11157"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182WPsskQcOF5iaZmPhHMPNRFsu2SY84/k=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:pf/9or3lBPyh4VlQOAi09UubgHg= sha1:CSW+ge/rSrrcBWEPNyL1cm2vKm4= Xref: g2news2.google.com comp.lang.ada:19620 Date: 2011-04-01T07:38:23+01:00 List-Id: "Randy Brukardt" writes: > "Simon Wright" wrote in message > news:m24o6jovd3.fsf@pushface.org... > ... >> I shall have a think about this, the 'access' approach is certainly >> neat. There's the question of whether null is allowed; if it is, and >> customers are using Ada95, 'access' is ruled out. > > All anonymous access types in Ada 95 were null excluding; passing "null" to > them was not allowed. The ARG recommended that all Ada 95 compilers support > "not null" syntactically (it would have no effect at runtime) in order to > minimize the incompatibility problems of switching back and forth between > Ada 95 and Ada 2005. Don't know if that recommendation was adopted widely (I > believe that Janus/Ada does allow it in Ada 95 mode). > > Either "in" or "access" in Ada 95 would not allow null, so if that is > needed, a named access type has to be used. Ada 2005 would require "not > null" if null is to be excluded (as noted, Ada 95 compilers are supposed to > support that, but who knows how many do). > > I personally don't like seeing access in any interface that can avoid it. > But if you need to be able to pass null, you don't have a choice. If not, I > think "in" is preferred. It took me a moment to see your point! which is, I think, that (from ARM B.3) pragma Convention (C) will pass structs and arrays as pointers anyway. Hmm. A binding generator will have trouble distinguishing the parameter mode, of course.