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: backlog4.nntp.dca3.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!news.stack.nl!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X Date: Tue, 15 Apr 2014 16:20:00 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> <8bhozh836pyt$.1qctlysud0s2q$.dlg@40tude.net> <1cdsyxjzsfgzm.1synpaujysv21$.dlg@40tude.net> <1aa804jg9qq4o$.wdiq33yo621l.dlg@40tude.net> <1w6eh0aiksmdh$.1h16p7y0b8c6h.dlg@40tude.net> <17twpp4p8u7o$.1idvzaaio4f3t$.dlg@40tude.net> <1wjmcbk375lzk.6o7dpqcp3va3.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1397596804 3047 69.95.181.76 (15 Apr 2014 21:20:04 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 15 Apr 2014 21:20:04 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: number.nntp.dca.giganews.com comp.lang.ada:185755 Date: 2014-04-15T16:20:00-05:00 List-Id: "Natasha Kerensikova" wrote in message news:slrnlkpnfe.i0l.lithiumcat@nat.rebma.instinctive.eu... ... > let's consider an abstract type T, with an abstract operation AO and a > huge part of the algorithm implemented in primitive operations for T, > making use of AO. Concrete descendants of T are supposed to implement > AO, and inherit the rest without overriding. > > Then in T subprograms I end up with things that look like: > AO (T'Class (Self), Other, Arguments); > > I've always thought of this as "re-disatching". Is it? I think it is as well. > Is it somehow more acceptable? (maybe it doesn't make any sense to > consider it as some "predicate with the same object viewed as T") Perhaps. The only cases where I've intentionally used re-dispatching look like this (one example: action routines in Claw, which are of course implemented by each extension -- but the bulk of the work is shared by all implementations). Such a case seems somehow different, but I don't think I can explain why. > Are there better language facilities to use in such situations? > (I used to use generics for that, and still do when there is absolutely > no plan for any child package) I don't know of any. One could use access-to-subprograms for such usage, but I don't see any big advantage to doing that instead -- there seems to be more chance of getting something wrong that way. (Failure to register, registering the wrong routine, etc. can't happen with the overridding routine solution.) I suspect that the reason re-dispatching is allowed is because there are some cases like this where nothing else would seem to work as well. But perhaps there is a better solution, we just haven't found it yet. Randy.