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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.67.5.132 with SMTP id cm4mr24290085pad.19.1448283902892; Mon, 23 Nov 2015 05:05:02 -0800 (PST) X-Received: by 10.182.241.195 with SMTP id wk3mr294401obc.8.1448283902742; Mon, 23 Nov 2015 05:05:02 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!mv3no1105454igc.0!news-out.google.com!f6ni11082igq.0!nntp.google.com!mv3no613303igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 23 Nov 2015 05:05:02 -0800 (PST) In-Reply-To: <1e4hyjazuvi88.159qsn7u0y067$.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.107.233.114; posting-account=6m7axgkAAADBKh082FfZLdYsJ24CXYi5 NNTP-Posting-Host: 94.107.233.114 References: <1e4hyjazuvi88.159qsn7u0y067$.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <817c092d-4c49-4b09-a116-6d27d4d20291@googlegroups.com> Subject: Re: operation can be dispatching in only one type From: Serge Robyns Injection-Date: Mon, 23 Nov 2015 13:05:02 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:28504 Date: 2015-11-23T05:05:02-08:00 List-Id: On Monday, 23 November 2015 12:29:55 UTC+1, Dmitry A. Kazakov wrote: > On Mon, 23 Nov 2015 02:23:57 -0800 (PST), Serge Robyns wrote: >=20 > > I'm facing an issue with Ada when it comes to use an operation on two > > tagged types. >=20 > You can use tagged types, they cannot be dispatching arguments though. Th= at > is a big difference. >=20 > > However in C++ it does work as I expected. >=20 > C++ has no multiple dispatch either. I'm not using multiple dispatching, I'm using "serial" dispatching. What I= 'm trying to achieve is very close to the concept of a mix-in. The code in = C++ is doing what I want to achieve. Update the specific balance and the "= parent" sum in a cheap and direct way. Obviously there is a potential "bug= " as I can pass any balance to the operation, including ones from another a= ccount. > It is too late to declare a dispatching operation on T_Balance when you > already used T_Balance as a type somewhere else, e.g. to instantiate a > package. >=20 As I said that operation is not dispatching on T_Balance, the T_Account ope= ration will be dispatching. As with regards to callback constructs, this sounds like "ugly" workarounds= IMHO. This weekend I've been re-writing the complete core "class" hierarchy in C+= +11 and 1 XML SAX parser into Xerces as a test. I still need to rewrite th= e existing business logic and decide on how to implement DAO for which I di= d a niece implementation in Ada (IMHO), as I can have mixture of data store= s for different components. The abstract interface is using multiple limit= ed interfaces. However I stumbled on something that looks very interesting= : ODB (C++) https://en.wikipedia.org/wiki/ODB_%28C%2B%2B%29. For Ada I did= use GNATCOLL but was also looking at Gnoga as an alternative. During that exercise I missed 2 major benefits of Ada. Very strong typing,= although C++11's "enum class" gives me the same when it comes to the primi= tive data types, i.e. scalars. And last but not least it's readability. I= love the Pascal family syntax. In my former C career I've suffered a lot = of imbalanced '{}'. And I've been looking at C replacements since the early= 1990's only to see that that syntax style is getting more and more spread.= :-( Having said that, I still didn't decide on which one to pursue, Ada 2012 or= C++ 11 or 14. One of the benefits of C++ is the very large collection of = 3rd party libraries. I do recognize the work of David Botton and yourself = in that area.