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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8385fc6e4bf20336 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!a70g2000hsh.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Generics with concrete and class-wide types Date: Tue, 1 Apr 2008 02:51:19 -0700 (PDT) Organization: http://groups.google.com Message-ID: <881a8e2c-01b2-462d-907b-f0887943acf4@a70g2000hsh.googlegroups.com> References: <279b6f4f-36cf-446f-8b54-fd72b957b22f@i7g2000prf.googlegroups.com> <10v8f09pvzjs6$.1r7fruma1fer5$.dlg@40tude.net> NNTP-Posting-Host: 128.141.45.242 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1207043479 25891 127.0.0.1 (1 Apr 2008 09:51:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 1 Apr 2008 09:51:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a70g2000hsh.googlegroups.com; posting-host=128.141.45.242; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20709 Date: 2008-04-01T02:51:19-07:00 List-Id: On 1 Kwi, 11:42, "Dmitry A. Kazakov" wrote: > Just a small side note. If you care about performance you should do exactly > the opposite you tried to, i.e. you should instantiate it with a specific > type rather than with a class of. This is exactly what I want to do. If I have the knowledge of the specific iterator type, I want to instantiate the subprogram with this specific type to facilitate direct dispatch and code inlining. When the only this I have is 'Class, then I want to instantiate the subprogram with what I have and agree for indirect dispatch to iterator operations within the subprogram body. The question is whether it is possible in Ada without walking on the edge of compiler conformance - and in particular without accidentally benefiting from any compiler bug that will bite me later on when it's fixed. Yes, some bugs can be harmful after they are fixed. :-) I will try the scheme proposed by Georg. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com