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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,604e0f87aa06eab6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-26 08:21:41 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.r-kom.de!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Imitation is the sincerest form of flattery Date: Wed, 26 Mar 2003 17:21:39 +0100 Message-ID: <1ij38vsm381u560p0rmhenia606ggo9jpv@4ax.com> References: <1048524746.273345@master.nyc.kbcfp.com> <1048530794.5794@master.nyc.kbcfp.com> <1048623730.801824@master.nyc.kbcfp.com> <8j838v81tn0t2ft4locfphs6tg6t7e1lvb@4ax.com> <1048691202.136151@master.nyc.kbcfp.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1048695699 80065121 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:35730 Date: 2003-03-26T17:21:39+01:00 List-Id: On Wed, 26 Mar 2003 10:06:41 -0500, Hyman Rosen wrote: >Dmitry A. Kazakov wrote: >> Wrong for what? There is no other way to specify a type set other than >> through closures of a subtyping relation. That's what inheritance is >> about. > >Yes there is. We've been through all this before. >The other way is through use patterns. Pattern is not a language term. So it cannot be an other way. Other way is cut'n'paste and patterns is a manual how to do it. >> Let you declare: >> void Foo (Element& X); >> then A[i] have to be of Element type to allow substitutability: >> >> Foo (A [i]); >> If A [i] is of some proxy class then you need ether to make the class >> a subtype of Element, or to write a wrapper for Foo. > >No, you declare > template void Foo(Element &X); >and you just call > Foo(A[i]); Exactly what I meant. It is no more a normal subroutine taking Element a parameter. All users of my array have to know that it is not an array; that they cannot index it is a normal way; that they have to review and redesign all the code working with the type Element if there is an array built on Element. Excellent. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de