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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: limited agregate and limited components default initialization Date: Tue, 3 Apr 2018 19:01:40 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <29943b13-00d1-443a-82f2-f55272770109@googlegroups.com> <12766e64-7641-45a0-8e76-8330a3b3c101@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 3 Apr 2018 17:01:41 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="6294fd639b54ae015ad3af8cd51aef87"; logging-data="3982"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eNnEDgQCBXTDkovbkk+MKpRON/vkEaGM=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:QOeDjNgY98Afnpi/TUWQS1GxT14= Xref: reader02.eternal-september.org comp.lang.ada:51318 Date: 2018-04-03T19:01:40+02:00 List-Id: > "Jean-Claude Rostaing" <00120260a@gmail.com> wrote in message > news:d83d9dd1-3674-4299-ac9c-1bf5862ae0e2@googlegroups.com... > > Shouldn't the expression > function > function GET (Pointer : Pointer_Type) return Accessor_Type is > (if Pointer.Pointer = null or else POINTER.Pointer.Value = null then > raise EXC_NULL_POINTER_ACCESS > else ACCESSOR_TYPE'(Data_Link => Pointer.Pointer.Value)); > be strictly equivalent to > function GET (Pointer : Pointer_Type) return Accessor_Type is > begin > if Pointer.Pointer = null or else POINTER.Pointer.Value = null then > raise EXC_NULL_POINTER_ACCESS; > else > return ACCESSOR_TYPE'(Data_Link => Pointer.Pointer.Value); > end if; > end GET; Technically, the expression function is equivalent to function Get (Pointer : Pointer_Type) return Accessor_Type is begin return (if Pointer.Pointer = null or else POINTER.Pointer.Value = null then raise EXC_NULL_POINTER_ACCESS else ACCESSOR_TYPE'(Data_Link => Pointer.Pointer.Value)); end Get; so it would be interesting to see what that does. I don't see any reason why your non-expression version wouldn't also be equivalent, too, though. -- Jeff Carter "[A] brilliant military career that after thirty years catapulted him to the rank of corporal." Take the Money and Run 138