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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5a88548f1bcf3510 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Received: by 10.180.95.227 with SMTP id dn3mr872379wib.1.1353057941813; Fri, 16 Nov 2012 01:25:41 -0800 (PST) Path: ha8ni292918wib.1!nntp.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!216.40.29.245.MISMATCH!novia!news-hub.siol.net!news1.t-com.hr!newsfeed.CARNet.hr!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Overring function and its returned type Date: Fri, 09 Nov 2012 22:36:02 +0100 Organization: Ada @ Home Message-ID: References: <1vej4u29b8e4z$.289wazkl31wg$.dlg@40tude.net> <16xl96g780qw8.1nc3x394b8m68.dlg@40tude.net> NNTP-Posting-Host: aWaWeUaBdaj2Zzc04J1v5A.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.02 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-11-09T22:36:02+01:00 List-Id: Le Fri, 09 Nov 2012 14:11:38 +0100, Dmitry A. Kazakov = a =C3=A9crit: > A more general question is about overriding out-operations to narrower= > subtypes, and/or overriding in-operations to wider subtypes. That coul= d > work. Nice to read this. Made me think of it too, with the added rule that `in= = out` would need to be fixed in overriding methods and not change their = type. However, about `out` mode, that may be more easy with function = returned object than with object =E2=80=9Creturned=E2=80=9D by an `out` = parameter. An = `out` parameter may not be updated as a whole, which is required for = example to change the type of a discriminated type with default = discriminants. The function result case is safer because more predictive= . = Or else, would have to require some `out` parameters to be updated as a = = whole. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity