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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,324453f076c10aeb X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: Exposing agreggate members of a class Date: 1999/01/03 Message-ID: #1/1 X-Deja-AN: 428385711 X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 References: <76cd39$21c8$1@news.gate.net> X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 915393052 nnrp-01:8180 NO-IDENT pogner.demon.co.uk:158.152.70.98 Organization: At Home Newsgroups: comp.lang.ada Date: 1999-01-03T00:00:00+00:00 List-Id: "David Botton" writes: > Given: > > with GCanvas_Package; use GCanvas_Package; > > type GWindow_Object is tagged with private; > type GWindow_Pointer is access all GWindow_Object; > > private: > > type GWindow_Object is tagged > record > Canvas : GCanvas_Object; > end record; > > What is the cleanest way to give access to the Canvas by reference in a way > that will not require Unchecked Programming You could use a generic: generic with procedure process (c : in out gcanvas_object); procedure access_canvas (g : gwindow_object); (actually, I suspect that should be (g : in out gwindow_object)) NB, I'm not sure you actually mean 'by reference' here? see LRM 6.2(2)