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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5f0f4bfb0467bb19 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.38.134 with SMTP id g6mr46210191pbk.6.1317392913356; Fri, 30 Sep 2011 07:28:33 -0700 (PDT) Path: lh7ni8336pbb.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: "Rego, P." Newsgroups: comp.lang.ada Subject: Re: Constructors with multiple inheritance Date: Fri, 30 Sep 2011 07:04:24 -0700 (PDT) Organization: http://groups.google.com Message-ID: <23774546.1654.1317391464047.JavaMail.geo-discussion-forums@yqnk41> References: <11513972.2788.1317325228383.JavaMail.geo-discussion-forums@yqnv12> <1rj1mmkvwud1d.dzqoy4jhdfca$.dlg@40tude.net> <4976045.4489.1317352313370.JavaMail.geo-discussion-forums@yqjw35> <2pu3h5hqltxi$.ze4yrf1f2y8z.dlg@40tude.net> Reply-To: comp.lang.ada@googlegroups.com NNTP-Posting-Host: 200.148.121.121 Mime-Version: 1.0 X-Trace: posting.google.com 1317392913 9134 127.0.0.1 (30 Sep 2011 14:28:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 30 Sep 2011 14:28:33 +0000 (UTC) Cc: mailbox@dmitry-kazakov.de In-Reply-To: <2pu3h5hqltxi$.ze4yrf1f2y8z.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=200.148.121.121; posting-account=TRgI1QoAAABSsYi-ox3Pi6N-JEKKU0cu User-Agent: G2/1.0 X-Google-Web-Client: true Xref: news1.google.com comp.lang.ada:18235 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2011-09-30T07:04:24-07:00 List-Id: > > Yes, I agree. But that's the point. I want to reserve the address (so I > > can build my queues from there). >=20 > The problem is not the result, but the argument of Construct. Ok. But did not understand the problem if the argument is null. =20 > > It works (and the current code utilizes this approach), but I cannot na= me > > it a method, >=20 > "method" is not an Ada term, but from the OO point of view Construct is a > method, because it is covariant in the result. I don't think "method" is a term owned by any language, the concept is outs= ide of the language implementation. But, whatever. So if I inherit a class = which have a method defined in the "function Construct return Parent_Class_= Ptr" form instead of the "function Construct (Obj : Parent_Class) return Pa= rent_Class_Ptr" it behaves the same manner? I.e., the childs have full acce= ss to the methods and can even override them?=20 > > since I cannot call the funtion from inside the class, using > > something like Object.Method. >=20 > X.Op is just a syntactic sugar for Op (X). It has nothing to do with an > operation being a method or not, except that in Ada the sugar is allowed > only for certain types of methods, rather than universally. >=20 > (The operation Op is a method of the type T in one of its arguments or th= e > result, when the type of that argument or result is T and Op is covariant > in it.) > > So I need to fix the > > package.function_constructor call and use a call of type > > object.method_constructor. >=20 > Why? Well, the prefixed notation if I understood well was made exactly for filli= ng this. For me it's not just sugar, since I use it frequently. I can even = cite the Rationale for Ada 2005 pg. 33, "the Ada 95 object oriented model h= as been criticized for not being really OO since the notation for applying = a subprogram (method) to an object emphasizes the subprogram and not the ob= ject.". So that's why I try not to use the package.function approach, and o= ne of the premisses of using the prefixed notation is "Y is the first param= eter of Op". =20 > What is wrong with the abstract factory pattern? Nothing wrong. I'm not questioning this.