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.0 required=5.0 tests=BAYES_00,URI_WP_DIRINDEX autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.cs.univ-paris8.fr!gegeweb.org!aioe.org!nospam From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: Access types as parameters Date: Sun, 19 Jul 2009 20:10:01 -0400 Organization: The Wasteland Message-ID: References: <521c4843-d40f-4545-9e80-ca725e847090@h21g2000yqa.googlegroups.com> <8410fc60-9b8a-4f82-92fc-622a6bbe5931@i18g2000pro.googlegroups.com> NNTP-Posting-Host: LQJtZWzu+iKlBROuDg+IUg.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.7.9 Cancel-Lock: sha1:qQCD8wy/QF1BSJc4ggTBP8d7msY= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Xref: g2news2.google.com comp.lang.ada:7162 Date: 2009-07-19T20:10:01-04:00 List-Id: In article , rickduley wrote: > 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? IIUC, "Thing" typically points to an object managed by the Gtk library. It's outside the scope of Ada's accessibility rules. > It actually uses the form (this for Gtk.Button.Gtk_Button): > procedure Initialize > (Button : access Gtk_Button_Record'Class; > Label : UTF8_String); The source mentions the section "Creating your own widgets" in the user's guide. The section "Creating new widgets in Ada" addresses the Initialize procedure explicitly: -- John B. Matthews trashgod at gmail dot com