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,f0be8eebb2993001 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news-2.dfn.de!news.dfn.de!news.uni-stuttgart.de!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Ada 2012 : aliased parameters ? Date: Thu, 28 Apr 2011 21:47:37 +0200 Message-ID: <87mxjaf99i.fsf@mid.deneb.enyo.de> References: <87aafgerez.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ruchba.enyo.de 1304020057 5096 172.17.135.6 (28 Apr 2011 19:47:37 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:S5hTDiqi7s9seImQjo+cuPGEtZM= Xref: g2news1.google.com comp.lang.ada:19076 Date: 2011-04-28T21:47:37+02:00 List-Id: * Randy Brukardt: >> Is it necessary that Element is a discriminant? > > Yes, because access discriminants have special accessibility rules which > happen to have the right effect. This is unfortunate because it means that this cannot be used to make variadic argument list trick safer and less of a hack. > It did, but only for bugs. The access discriminant semantics is from Ada 95, > although it was never defined properly (probably still isn't, although not > for the lack to trying). We've just found a good use for the strange > semantics. I don't think the difference is observable in Ada 95 because you couldn't return new objects of limited type. By the way, how tight are the access level checks? Is it relatively safe to assume that if an Ada 2005 compiler compiles a program which makes heavy use of anonymous access types and runs it without exceptions, then there are no dangling pointers? (Ignoring unchecked deallocation, of course.)