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,FREEMAIL_FROM autolearn=ham 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-16 10:59:42 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!spool0900.news.uu.net!reader0901.news.uu.net!not-for-mail Date: Thu, 16 Jan 2003 13:59:38 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. 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> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1042743579.1165@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1042743580 reader1.ash.ops.us.uu.net 1354 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:33099 Date: 2003-01-16T13:59:38-05:00 List-Id: 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. > 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. > 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. > 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.