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,72113392dc4997bd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-17 13:24:26 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsgate.duke.edu!newsfeed!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Subprogram Pointer in a Generic Date: 17 Apr 2003 16:24:25 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1050611065 8186 199.172.62.241 (17 Apr 2003 20:24:25 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 17 Apr 2003 20:24:25 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:36248 Date: 2003-04-17T16:24:25-04:00 List-Id: tmoran@acm.org writes: > >(1) The absence of such a rule would prevent an implementation from > > implementing efficiently shared generic packages: > Would it be possible to do code sharing at all? > type Young is range 1 .. 20; > type Old is range 21 .. 120; > package a is new generic_package(Young); > package b is new generic_package(Old); > and inside generic_package you make a call on > Register(Local_Procedure'access); > What is registered - the instantiation of Local_Procedure that deals > with Young or the one that deals with Old? Extra information needs to > be passed along, but Register expects just a simple pointer. It is certainly possible, but Randy Brukardt will tell you it's not easy, and probably not possible to do efficiently. - Bob