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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-08 05:31:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!dialin-145-254-038-082.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. Date: Wed, 08 Jan 2003 14:19:24 +0100 Organization: At home Message-ID: References: <1041908422.928308@master.nyc.kbcfp.com> <1041997309.165001@master.nyc.kbcfp.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-038-082.arcor-ip.net (145.254.38.82) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1042031933 16500956 145.254.38.82 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:32744 Date: 2003-01-08T14:19:24+01:00 List-Id: Hyman Rosen wrote: > Dmitry A. Kazakov wrote: >> This is also possible with tagged types. You are free to make >> operations inline. The compiler may remove the type tag if it is >> statically known. Under these conditions a static dispatch would cost >> nothing. > > The point here is using your newly created types with libraries of > existing code which are to operate on those types. If those libraries > are generic, then it may be possible to get significant inlining > benefits. If those libraries operate on tagged types, then it won't > matter that *you* know the static type in your code, because the > library won't. It's the difference, in C++ terms, between qsort and > std::sort. The former takes a pointer to function which it must call > for each comparison, while the latter can inline the comparison. But this is not generics vs. tagged, it is inlined vs. not. It is clear that an inlined subroutine cannot be put into a library. The difference is only that tagged types leave me a choice, while generics don't. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de