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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b88383a5d9c51aa0 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada-Singleton-Why does it work like this? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <5a7a870c-40e2-4803-8753-0f9cfd2b800f@k2g2000yql.googlegroups.com> <6d2b2c67-22fb-4283-87ab-58357e47d5ca@v39g2000yqm.googlegroups.com> Date: Wed, 25 Mar 2009 10:30:24 +0100 Message-ID: NNTP-Posting-Date: 25 Mar 2009 10:30:24 CET NNTP-Posting-Host: 528ef4fe.newsspool4.arcor-online.net X-Trace: DXC=V36oI3XQC88_A0jCfgHO6>4IUKkg2EI_ZM7XaRa1 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:5249 Date: 2009-03-25T10:30:24+01:00 List-Id: On Tue, 24 Mar 2009 17:10:11 -0700 (PDT), Martin wrote: > On Mar 24, 8:47�pm, "Jeffrey R. Carter" >> This is a very poor solution to the problem. A much simpler solution is >> >> package Singleton is >> � � procedure Set (Value_1 : in Integer; Value_2 : in Integer); >> >> � � procedure Print; >> end Singleton; > > But you can not derive a class from this: Firstly you can. There are child packages in Ada, they are equivalent to derivation. Secondly, you may not because it is a singleton. A derived variant would be meaningless without making an instance of, which would be *another* instance of now non-singleton. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de