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: 103376,f3687114209e3c2c X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!news.glorb.com!news.cs.univ-paris8.fr!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Abusing tagged types Date: Fri, 28 Nov 2008 15:35:43 +0100 Organization: Adalog Message-ID: <7kvogg.8dj.ln@hunter.axlog.fr> References: <87y6z4cefp.fsf@willow.rfc1149.net> <7cca32f3-0815-4564-b83a-d19a0e59b8ab@l42g2000yqe.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1227878081 19341 195.25.228.57 (28 Nov 2008 13:14:41 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 28 Nov 2008 13:14:41 +0000 (UTC) User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) In-Reply-To: <7cca32f3-0815-4564-b83a-d19a0e59b8ab@l42g2000yqe.googlegroups.com> Xref: g2news2.google.com comp.lang.ada:3804 Date: 2008-11-28T15:35:43+01:00 List-Id: Maciej Sobczak a �crit : > I'm asking about the design principles - the *purpose* of tagged type > is to achieve polymorphism with dispatching calls. Is it OK to use > tagged type without this motivation? One of the nice things in Ada is the ability to make a difference between a method and a subprogram (and yes, I'm afraid about the new generation of programmers who know only classes as unit of modularization, and call every subprogram a method). IMHO, the term method should be reserved to operations that have a general semantics, but whose implementation (the way of doing the thing - the /method/ for doing the thing) depends on the type to which it applies. Methods make sense only in the presence of dynamic dispatching, i.e. the ability to tell an object: "do this your own way". O.M notation stresses this by making clearer that a method is applied to a given object. Although subprograms may have a parameter of a non-tagged type which is in some sense distinguished, they are not methods by my definition, and I would not favour using that notation (to be honnest, I've never been a great fan of the O.M notation in any case - it is misleading if you have more than one controlling operand, which is a great superiority of Ada over other OO languages). -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr