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!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Suggestion: Allow functions returning abstract types in certain situations Date: Sat, 24 May 2014 14:45:42 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <06f66a19-00f1-405f-a517-05d18a021b65@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1400957139 21062 192.74.137.71 (24 May 2014 18:45:39 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 24 May 2014 18:45:39 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:CtBJGN0KbqxohpkgEdxDMmX0CwY= Xref: news.eternal-september.org comp.lang.ada:20012 Date: 2014-05-24T14:45:42-04:00 List-Id: (sorry for email; I meant to post) Adam Beneschan writes: > On Wednesday, May 21, 2014 4:19:21 PM UTC-7, Robert A Duff wrote: > >> Not sure what you mean about "redispatch". You can't [re]dispatch >> without converting to class-wide. > > It didn't occur to me until later that your idea about forbidding a > conversion from an abstract type to a class-wide type has to be a > run-time check, not a compile-time check (or not solely a compile-time > check). Otherwise, if an operation of a concrete type converts a > controlling parameter to a class-wide type, and then an abstract type > is derived without overriding the operation, the code would then be > converting the abstract object to a class-wide type unless it were > checked at run-time. > > That's the sort of scenario I was thinking of when I mentioned > Initialize/Adjust/Finalize doing a redispatch. Ah, I see. That's essentially the same as Dmitry's point 2. I don't think it's specific to I/A/F. Yes, it could be a run-time check, but I'd much prefer a compile-time check, even if it's rather restrictive. Currently, dangling dispatch is prevented by compile-time rules, and I'd like to keep it that way. - Bob