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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Access types as parameters Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <521c4843-d40f-4545-9e80-ca725e847090@h21g2000yqa.googlegroups.com> <8410fc60-9b8a-4f82-92fc-622a6bbe5931@i18g2000pro.googlegroups.com> Date: Mon, 20 Jul 2009 10:13:48 +0200 Message-ID: <1j9zxynl0weej$.54ava16yri5b$.dlg@40tude.net> NNTP-Posting-Date: 20 Jul 2009 10:13:47 CEST NNTP-Posting-Host: bea55eb2.newsspool2.arcor-online.net X-Trace: DXC=4Z32Jo8O?gdg`45cDR8l?oA9EHlD;3Ycb4Fo<]lROoRa^YC2XCjHcbi^FoTjPekXkhDNcfSJ;bb[eIRnRBaCd`SRFlmY8WVD[m\=k X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7164 Date: 2009-07-20T10:13:47+02:00 List-Id: On Sun, 19 Jul 2009 15:57:12 -0700 (PDT), rickduley 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, alas! > i.e.: > function My_Function (Thing : access My_Type'Class) return Positive; > for an 'Initialize' function? You mean function My_Function (Thing : access Gtk_XXX_Record'Class) return Positive; I think it should better be function My_Function (Thing : Gtk_XXX) return Positive; since GtkAda has Gtk_XXX declared as access to every Gtk_XXX_Record'Class. > It actually uses the form (this for Gtk.Button.Gtk_Button): > procedure Initialize > (Button : access Gtk_Button_Record'Class; > Label : UTF8_String); Well, this is likely a design bug. Gtk_Object_Record should have been limited controlled with Initialize inherited from Ada.Finalization.Limited_Controlled. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de