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: border2.nntp.ams3.giganews.com!backlog4.nntp.ams3.giganews.com!backlog4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Natasha Kerensikova Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X Date: Tue, 15 Apr 2014 07:21:18 +0000 (UTC) Organization: A noiseless patient Spider 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> Injection-Date: Tue, 15 Apr 2014 07:21:18 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="76a49b86bc3e16725b7cfca3d85cb4c8"; logging-data="27972"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+s/AgMUBnYhk1RHtPV3oi6" User-Agent: slrn/1.0.1 (FreeBSD) Cancel-Lock: sha1:Tge9WuPsiage5ilv0k/msXt38ig= X-Original-Bytes: 4001 Date: 2014-04-15T07:21:18+00:00 List-Id: Hello, On 2014-04-15, Randy Brukardt wrote: > "Niklas Holsti" wrote in message > news:br07nkFnvrbU1@mid.individual.net... > ... >> (This is why I don't understand your and Randy's abhorrence of >> re-dispatching -- to me, there is no basic difference between >> dispatching calls in class-wide operations, and re-dispatching calls in >> primitive operations.) > > [...] > > Finally (really a restating of the last point), I find that it's fairly easy > to ensure that all of the primitive operations of a particular type have the > same world-view. That's not as true when some of the operations are assuming > the object is of type T, and some are re-dispatching to some TT derived from > T -- I've found many instances where some predicate of TT gets a different > answer than the same predicate of the same object viewed as a T. That sort > of things leads to all kinds of bugs, because not all of those predicates > are explicit in the code (even as statically bound calls). > > This last issue doesn't arise for a class-wide operation, where every call > is going to look at an object of TT as type TT. And that's really the major > difference between "dispatching" and "re-dispatching". Thanks for the explanation, but I'm a bit lost where the situation I have encountered the most fits in "dispatching" vs "re-dispatching": 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? 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") 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) Thanks for the clarification, Natasha