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,965fbd9798ca1677 X-Google-Attributes: gid103376,public From: lutz@iks-jena.de (Lutz Donnerhacke) Subject: Re: Return by reference Date: 1999/11/02 Message-ID: #1/1 X-Deja-AN: 543459649 Distribution: world Content-Transfer-Encoding: 8bit References: Content-Type: text/plain; charset=ISO-8859-1 Organization: IKS GmbH Jena Mime-Version: 1.0 User-Agent: slrn/0.9.5.7 (UNIX) Newsgroups: comp.lang.ada Date: 1999-11-02T00:00:00+00:00 List-Id: * Brian Rogoff wrote: >I understand why, for a return-by-reference type T, the function [...] >causes Program_Error to be raised at run time, but I'm a bit >perplexed as to why there is a problem for > >function Some_Func( Param : T; ... ) return T is >begin > ... > return Param; >end Some_Func; May you explain a bit more why you are returning a 'constant' 'in' parameter? OTOH it might be a problem in your calling function. type S is tagged new T with record ... end record; aS: S := Some_Func(aT); -- may cause the error.