comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Access types as parameters
Date: Mon, 20 Jul 2009 19:34:56 -0500
Date: 2009-07-20T19:34:56-05:00	[thread overview]
Message-ID: <h432h7$hjg$1@munin.nbi.dk> (raw)
In-Reply-To: e325296c-7114-4540-9406-b7426da408dd@f18g2000prf.googlegroups.com

"rickduley" <rickduley@gmail.com> wrote in message 
news:e325296c-7114-4540-9406-b7426da408dd@f18g2000prf.googlegroups.com...
> Hi Randy
>
> You wrote:
>> So it is best to avoid the first form unless you have a particular need 
>> for
>> dispatching on an access value (which won't happen here, because the
>> designated type is class-wide).
>
> Why then does GtkAda consistently use the first form, i.e.:
> function My_Function (Thing : access My_Type'Class) return Positive;
> for an 'Initialize' function?
>
> It actually uses the form (this for Gtk.Button.Gtk_Button):
> procedure Initialize
>  (Button : access Gtk_Button_Record'Class;
>   Label  : UTF8_String);

You'd have to ask the designers of GTKAda that question. I think it's 
terrible to define Ada-level interfaces that way, but they may have had good 
reasons. See Claw 
(http://www.rrsoftware.com/html/prodinf/claw/clawintro.html for the free 
version) to see how I think a real-world Ada GUI library ought to be 
designed. (Well, more accurately, how I thought 10 years ago, I'd make some 
minor changes today, mainly making most of the types limited, as that works 
much better in Ada nowadays).

                                     Randy.


                                     Randy. 





  parent reply	other threads:[~2009-07-21  0:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-17  8:39 Access types as parameters Rick
2009-07-17 15:03 ` Adam Beneschan
2009-07-17 16:28   ` Hibou57 (Yannick Duchêne)
2009-07-17 23:25     ` rickduley
2009-07-18  1:03       ` Randy Brukardt
2009-07-19 22:57         ` rickduley
2009-07-20  0:10           ` John B. Matthews
2009-07-20  8:13           ` Dmitry A. Kazakov
2009-07-21  0:34           ` Randy Brukardt [this message]
2009-07-21 14:34           ` Adam Beneschan
2009-07-23  2:11             ` Stephen Leake
2009-08-11 23:41               ` Randy Brukardt
2009-08-12  2:22                 ` Stephen Leake
2009-08-13  1:06                   ` Randy Brukardt
2009-08-13  8:34                     ` Niklas Holsti
2009-08-13  9:15                       ` Dmitry A. Kazakov
2009-08-13 20:13                         ` Niklas Holsti
2009-08-13 21:07                           ` Dmitry A. Kazakov
2009-08-14  9:27                             ` Niklas Holsti
2009-08-14 10:36                               ` Dmitry A. Kazakov
2009-08-14 16:03                                 ` Niklas Holsti
2009-08-15  9:47                                   ` Dmitry A. Kazakov
2009-08-15 19:19                                     ` Niklas Holsti
2009-08-16  8:32                                       ` Dmitry A. Kazakov
2009-08-16  9:52                                         ` Niklas Holsti
2009-08-16 12:38                                           ` Dmitry A. Kazakov
2009-08-16 13:21                                             ` Niklas Holsti
2009-08-16 17:58                                               ` Dmitry A. Kazakov
2009-08-14  4:07                       ` Randy Brukardt
2009-08-14 10:22                         ` Niklas Holsti
2009-08-18 12:22                     ` Stephen Leake
replies disabled

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