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-17 08:28:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!dialin-145-254-038-248.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: Fri, 17 Jan 2003 17:28:25 +0100 Organization: At home Message-ID: References: <1041908422.928308@master.nyc.kbcfp.com> <1041997309.165001@master.nyc.kbcfp.com> <1042086217.253468@master.nyc.kbcfp.com> <1042477504.547640@master.nyc.kbcfp.com> <1042651417.215661@master.nyc.kbcfp.com> <1042743579.1165@master.nyc.kbcfp.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-038-248.arcor-ip.net (145.254.38.248) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1042820930 24375040 145.254.38.248 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:33141 Date: 2003-01-17T17:28:25+01:00 List-Id: Hyman Rosen wrote: > Dmitry A. Kazakov wrote: >> This mechanism and generics are both designed *just* for variation. > > The dispatching mechanism is designed for runtime variation. > The generic mechanism is designed for compile-time variation. > Just because you can occasionally track types well enough > through dispatching code so that dispatches can be replaced > with explicit calls doesn't change that. Not occasionaly, but when they are statically known. There is absolutely no difference with generics, which also "occasionally" work in this case. >> I see no advantages in this case. > > The advantage is that more efficient (smaller/faster) code > can be generated from generics, if not in theory then certainly > in practice. Programming languages are not just abstract > constructs, they are means for generating sequences of native > machine code to perform some task. I never argued this point, which actually sounds: we use them because there is nothing better. But this does not exclude that there could be something better than generics. >> It is same as to claim that (generic) > > is better than (discriminated type) > > Yes, and that's a valid claim. Given a fixed size, it's likely > that better code can be generated than when the size must be > passed around as a variable. Seems that you are summoning the ghost of Pascal-strings. (:-)) Leave them resting in peace, they are useless! > > What's the use of a variation over a type set if you are unable > > to specify an element of the set? > > The use is to specify an operation on elements of the set a > single time, and yet have that operation work for many elements. But because you cannot specify the set, you are very limited in which operation you can define. For instance, you cannot have an iterator of the set, you cannot have subsets, pointers, containers and many other things which make ADT so useful. This is the price of text substitution. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de