comp.lang.ada
 help / color / mirror / Atom feed
From: "Lucretia" <lucretia9@lycos.co.uk>
Subject: Re: Private primitive operations available to entire package hierarchy. Can it be done?
Date: 28 Jul 2005 03:09:39 -0700
Date: 2005-07-28T03:09:39-07:00	[thread overview]
Message-ID: <1122545378.984920.272260@g47g2000cwa.googlegroups.com> (raw)
In-Reply-To: <grqdnRKB5o86ZnrfRVn-pA@megapath.net>

<quote>
> Add(Some_Sizer, Self.Button'Unchecked_Access..­.);

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.
</quote>

Yes, that line would be in the user code as Add is a primitive to
wx.Core.Sizer.Sizer_Type.

<quote>
> 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.
</quote>

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 :-/

<quote>
And the implementation of Add:


    procedure Add (Sizer : Sizer_Type; Button : Button_Type'Class) is
         My_Button : Any_Button_Access_Type := Button'Unchecked_Access;

         My_Sizer : Any_Sizer_Access_Type := 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
</quote>

I thought that it was considered bad to get the access of a parameter
in this way?




  reply	other threads:[~2005-07-28 10:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-07 16:06 Private primitive operations available to entire package hierarchy. Can it be done? Lucretia
2005-07-07 16:17 ` OT: Joke Adrien Plisson
2005-07-07 16:24   ` Matthew Heaney
2005-07-07 19:10 ` Private primitive operations available to entire package hierarchy. Can it be done? Randy Brukardt
2005-07-13 15:40   ` Lucretia
2005-07-19 23:19     ` Randy Brukardt
2005-07-20 18:14       ` Lucretia
2005-07-21  3:10         ` Randy Brukardt
2005-07-25 18:14           ` Lucretia
2005-07-25 23:58             ` Randy Brukardt
2005-07-27 17:36               ` Lucretia
2005-07-27 21:28                 ` Randy Brukardt
2005-07-28 10:09                   ` Lucretia [this message]
2005-07-29  0:40                     ` Randy Brukardt
2005-08-02 15:55                       ` Lucretia
2005-08-03 18:26                         ` Lucretia
2005-08-03 20:04                           ` Randy Brukardt
2005-08-03 20:03                         ` Randy Brukardt
2005-08-08 18:04                           ` Lucretia
2005-08-08 20:47                             ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox