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-Thread: a07f3367d7,7ff1de84a8945e80 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Access types as parameters Date: Mon, 20 Jul 2009 19:34:56 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <521c4843-d40f-4545-9e80-ca725e847090@h21g2000yqa.googlegroups.com> <8410fc60-9b8a-4f82-92fc-622a6bbe5931@i18g2000pro.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1248136551 18032 69.95.181.76 (21 Jul 2009 00:35:51 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 21 Jul 2009 00:35:51 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news2.google.com comp.lang.ada:7195 Date: 2009-07-20T19:34:56-05:00 List-Id: "rickduley" 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.