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,927ae253da8bb547 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-31 13:02:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!kibo.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Specialization Date: 31 May 2002 20:46:52 +0100 Organization: Pushface Sender: simon@smaug Message-ID: References: <4519e058.0205300909.5bfb317d@posting.google.com> NNTP-Posting-Host: pogner.demon.co.uk X-NNTP-Posting-Host: pogner.demon.co.uk:62.49.19.209 X-Trace: news.demon.co.uk 1022875267 nnrp-01:19856 NO-IDENT pogner.demon.co.uk:62.49.19.209 X-Complaints-To: abuse@demon.net User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: archiver1.google.com comp.lang.ada:25117 Date: 2002-05-31T20:46:52+01:00 List-Id: Stephen Leake writes: > One more: require the client to pass in a Finalize procedure: > > generic > type Element is private; > with procedure Finalize (Item : in out Element) is <>; > package Foo is > type Element_array is array (1 .. 10) of Element; > > procedure Empty (Item : in out Element_Array); > > end Foo; > > Now Empty can call Finalize on each element of the array. For > non-controlled types, Finalize can be a null operation. This is the > approach I use in SAL; it allows a generic package to be > instantiated with the widest range of types. I like this. The Element probably has to be visibly (to the client) controlled, for her to get hold of the Finalize.