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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,54aae3da1cf935cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!news-out.visi.com!petbe.visi.com!upp1.onvoy!onvoy.com!news7.onvoy.net.POSTED!not-for-mail Message-ID: <414E47D9.3080105@y.com> From: Pylinius User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada Singleton Pattern References: <%Fi1d.245967$OR2.11136154@news3.tin.it> <414CAC2B.60400@y.com> <1ec946d1.0409182019.30467e1a@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 20 Sep 2004 03:03:34 GMT NNTP-Posting-Host: 137.192.58.184 X-Complaints-To: abuse@onvoy.com X-Trace: news7.onvoy.net 1095649414 137.192.58.184 (Sun, 19 Sep 2004 22:03:34 CDT) NNTP-Posting-Date: Sun, 19 Sep 2004 22:03:34 CDT Organization: Onvoy Xref: g2news1.google.com comp.lang.ada:3855 Date: 2004-09-20T03:03:34+00:00 List-Id: Matthew Heaney wrote: > Pylinius wrote in message news:<414CAC2B.60400@y.com>... > >>Luca Stasio wrote: >> >>>Hi, there is a way to implement the Singleton Pattern in Ada? >>>There are some examples out there? >>>Thanx. >>> >>package Example_Of_Singleton is >> >> procedure Do_Something; >> >> procedure Do_Something_Else; >> >>end; >> >> >>Bring it on you stupid GangOfFour bastards, with your idiotic bloated >>idioms that inculcate and contaminate perfectly good alternative >>languages! >> > > > I alluded to this in my previous post. To be fair, though, you can do > this in C++ too: > > namespace Example_Of_Singleton > { > void do_something(); > void do_something_else(); > } > > One advantage of using a type is if the type is tagged. If there's a > singleton instance of type in the class, then you can use that as a > value of an object whose type is class-wide. > > However, most of the time you don't need all of this infrastructure, > and the package/namespace technique is perfectly adequate. > > -Matt > Thank you, and thanks for Charles, which essentially achieves the capabilities that the Ada gods intended without being a whore to the mindless C++/Java mindset.