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,29d8139471e3f53e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!t7g2000vbj.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Preventing type extensions Date: Thu, 16 Sep 2010 17:16:52 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1c27b555-0832-413a-b585-e5c6b22e8ac4@t7g2000vbj.googlegroups.com> References: <87iq2bfenl.fsf@mid.deneb.enyo.de> <874odv9npv.fsf@ludovic-brenta.org> <87y6b7cedd.fsf@mid.deneb.enyo.de> <66a3704c-54f9-4f04-8860-aa12f516134b@t3g2000vbb.googlegroups.com> <87d3sib44t.fsf@mid.deneb.enyo.de> <134q4k2ly2pf4$.17nlv1q6q5ivo.dlg@40tude.net> NNTP-Posting-Host: 174.28.230.86 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1284682613 7638 127.0.0.1 (17 Sep 2010 00:16:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 17 Sep 2010 00:16:53 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t7g2000vbj.googlegroups.com; posting-host=174.28.230.86; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729; .NET CLR 4.0.20506),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14134 Date: 2010-09-16T17:16:52-07:00 List-Id: > Final classes make no sense. I am glad that at least this was not borrowed > by Ada ... yet. I agree; final classes are a bad idea -- Unless the object's behavior is perfect and there can [in no way] be a changed requirement... which almost never happens. There have been times where I've had to 'extend' a final Java class by embedding it into another class and writing all the methods as passthroughs except for the ones I needed to introduce some [usually slightly] different behavior. On the original poster's topic; is there anything from doing something like: Package Some_Object_Package is Type Object-Type is private; -- Elementery functions. private Type Object-Type is tagged null record; end package Some_Object_Package; Sure, a child-package could be introduced to extend the object, but its specification cannot rely on anything not publicly visible in its parent's specification... meaning that the public portion of the object cannot expose that it is a tagged record. Right?