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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,72c34c66b38e0e05 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-03 11:30:08 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Proposal: Constructors, Assignment [LONG] Date: Fri, 3 Jan 2003 13:29:51 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:32501 Date: 2003-01-03T13:29:51-06:00 List-Id: Dmitry A. Kazakov wrote in message ... >Randy Brukardt wrote: > >> No, this is illegal. There can only be one result object declared. And >> if there is one, returning anything else is illegal. So the declaration >> of Result2 and the return of Result3 are illegal. >> >>>I am not sure, but to determine whether there is only one result, could >>>be equivalent to halting problem. So some sort of run-time support will >>>be well required to determine this. Or will it be classified as one more >>>bound error? >> >> No, these are all compile-time checks. No run-time penalty at all. > >And this? > >function Make_Session (Count: Integer) return Internet_Session is >begin > for Index in Integer'Range loop > declare > Result : return Internet_Session (Index); > begin > if HALT (x) then > return Result; > end if; > end; > end loop; >end Make_Session; That would raise Program_Error if Halt was never true, because there was no return in the function. That of course is the same as the current Ada rule. Randy.