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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: operation can be dispatching in only one type Date: Tue, 24 Nov 2015 13:18:06 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <04eb6626-644b-4b16-a329-c35659a9fbe2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 24 Nov 2015 20:15:46 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="caa759af2a9c666aec02942f6fe5abd6"; logging-data="5446"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186GB5k/w/yxbaHuiLwaLjBQ/57SC6IlLo=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: X-Mozilla-News-Host: news://freenews.netfront.net Cancel-Lock: sha1:AvidEtYsjxhg23svlJi49DXds5w= Xref: news.eternal-september.org comp.lang.ada:28527 Date: 2015-11-24T13:18:06-07:00 List-Id: On 11/24/2015 11:37 AM, Serge Robyns wrote: > > 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; Yes, only a tagged type can be extended (and any derivation from a tagged type requires an extension), but a new type can be derived from any type: type Control_Info is record Active : Boolean; end record; type External_Control is new Control_Info; for External_Control use record Active at 1 range 3 .. 3; end record; > > I agree and so far the need is limited. However I do love the obj.method notation 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 any OO language. Hence facing such issues now will avoid me to re-design the whole thing later on because of an oversight due to lack of Ada experience. 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 for the C programmer with some experience in old C++ and Java. And besides this group, I know no one using Ada. Have you looked at /Ada Distilled/? It is Ada for the experienced programmer. -- Jeff Carter "Whatever it is, I'm against it." Horse Feathers 46