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.98.86.136 with SMTP id h8mr18237395pfj.11.1448390277663; Tue, 24 Nov 2015 10:37:57 -0800 (PST) X-Received: by 10.182.166.8 with SMTP id zc8mr110485obb.18.1448390277625; Tue, 24 Nov 2015 10:37:57 -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!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!mv3no2389175igc.0!news-out.google.com!f6ni12367igq.0!nntp.google.com!mv3no1632689igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 24 Nov 2015 10:37:57 -0800 (PST) In-Reply-To: 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: <04eb6626-644b-4b16-a329-c35659a9fbe2@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: operation can be dispatching in only one type From: Serge Robyns Injection-Date: Tue, 24 Nov 2015 18:37:57 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3377 X-Received-Body-CRC: 526153022 Xref: news.eternal-september.org comp.lang.ada:28526 Date: 2015-11-24T10:37:57-08:00 List-Id: On Tuesday, 24 November 2015 18:09:14 UTC+1, Jeffrey R. Carter wrote: > > Like for example creating new specialized versions of the T_Account and= per the rules you can only write "type New_T is new Old_T" for tagged type= s. >=20 > The Ada-95 designers built on that to provide type extension: >=20 > type George is new Martha with record ... This is what I get with gnat2015: type derived from untagged type cannot have extension for: type T_Control is record Name : T_Control_Name; end record; type T_Counter_Control is new T_Control with record Counter : Natural; end record; PS: T_Control_Name is a type derived straight from T_Strings_20.Bounded_Str= ing (instance of the generic package) in case this should matter but I beli= eve not. > The only thing you *need* tagged types for in Ada is finalization. They a= lso > provide Object.Operation notation, which is nice, and many types are decl= ared > tagged solely to provide that (the containers are examples of this). Type > extension, combined with a container, also provides a kind of syntactic n= oise > that allows self-referential types without access types/values. >=20 > Other than those uses, with adequate thought before beginning coding, one= can > implement anything more clearly without tagged types than with. I agree and so far the need is limited. However I do love the obj.method n= otation which was my initial reason for using tagged types everywhere. And= I do expect needs on the business objects, like indeed finalization and a = few specializations. True back in the 80's we did those 'tricks' without a= ny OO language. Hence facing such issues now will avoid me to re-design th= e whole thing later on because of an oversight due to lack of Ada experienc= e. This is my biggest fear for me; to pursue my project in Ada rather than= to go more for my older friends. I'm more the guy that should read Ada fo= r the C programmer with some experience in old C++ and Java. And besides t= his group, I know no one using Ada. Serge