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-Thread: 103376,a3f460aaba1863e2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!g47g2000cwa.googlegroups.com!not-for-mail From: "Lucretia" Newsgroups: comp.lang.ada Subject: Re: Private primitive operations available to entire package hierarchy. Can it be done? Date: 28 Jul 2005 03:09:39 -0700 Organization: http://groups.google.com Message-ID: <1122545378.984920.272260@g47g2000cwa.googlegroups.com> References: <1120752411.808598.292980@g49g2000cwa.googlegroups.com> <1121269243.013754.57720@g14g2000cwa.googlegroups.com> <1121883276.400592.326630@o13g2000cwo.googlegroups.com> <1122315253.757948.150350@z14g2000cwz.googlegroups.com> <8_ydncLVTeRn5njfRVn-jA@megapath.net> <1122485760.918191.274380@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: 194.74.199.42 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1122545385 9759 127.0.0.1 (28 Jul 2005 10:09:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 28 Jul 2005 10:09:45 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: g47g2000cwa.googlegroups.com; posting-host=194.74.199.42; posting-account=G-J9fgwAAADgpzBiEyy5tO4f8MX5fbpw Xref: g2news1.google.com comp.lang.ada:3814 Date: 2005-07-28T03:09:39-07:00 List-Id: > Add(Some_Sizer, Self.Button'Unchecked_Access..=AD.); Is this in the user code, or in the implementation of the interface? If it's in the implementation of the interface, do whatever you have to do. If it's in the user code, though, I'd claim that the Add routine is incorrectly specified -- it should simply pass the Button_Type object and the code *internal* to the binding should be creating the access types. Yes, that line would be in the user code as Add is a primitive to wx.Core.Sizer.Sizer_Type. > and having all primitives take an access parameter as the controlling > parameter. That's awful. If you do that, you're requiring your user to do memory management for you, rather than the other way around. They'll be forced into subpar syntax (explicit uses of aliased and 'Access), have runtime accessibility errors, and other nastyness. And they would have no way to use the containers library do the storage management for them. What's awful? Using access parameters as the controlling type or just using instances the way I have been doing? I don't really see what you mean about forcing the user into handling the memory management. subpar syntax? Dunno what that means :-/ And the implementation of Add: procedure Add (Sizer : Sizer_Type; Button : Button_Type'Class) is My_Button : Any_Button_Access_Type :=3D Button'Unchecked_Access; My_Sizer : Any_Sizer_Access_Type :=3D Sizer'Unchecked_Access; begin -- Call the low level (C) routines: wx_Add (My_Sizer, My_Button); -- etc. end Add; You might need to do some type conversions on the access types, but that's I thought that it was considered bad to get the access of a parameter in this way?