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.129.76.70 with SMTP id z67mr9786400ywa.25.1438472357285; Sat, 01 Aug 2015 16:39:17 -0700 (PDT) X-Received: by 10.140.104.147 with SMTP id a19mr84432qgf.2.1438472357268; Sat, 01 Aug 2015 16:39:17 -0700 (PDT) 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!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!69no3332919qgl.1!news-out.google.com!78ni2619qge.1!nntp.google.com!z61no4696743qge.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 1 Aug 2015 16:39:16 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=81.203.145.32; posting-account=AFCLjAoAAABJAOf_HjgEEEi3ty-lG5m2 NNTP-Posting-Host: 81.203.145.32 References: <91f88d79-197c-419f-84a8-908e05967a2c@googlegroups.com> <135c2b00-d13c-4f5d-a586-8aca442d363b@googlegroups.com> <87380683vc.fsf@adaheads.sparre-andersen.dk> <347c6be9-c918-4bc0-9494-c93cd6740def@googlegroups.com> <4cb32c40-f659-490d-bbb6-73585fc069e8@googlegroups.com> <7e653a88-e690-431a-9df9-3fc691466e08@googlegroups.com> <25e8deb9-a967-4856-97cb-4257e1ba7fa4@googlegroups.com> <84debe67-b26c-40c6-93ae-a2dec28f081b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <83abe7a5-69d6-4443-a976-f3b3fbed892a@googlegroups.com> Subject: Re: Running a preprocessor from GPS? From: EGarrulo Injection-Date: Sat, 01 Aug 2015 23:39:17 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 3137 X-Received-Body-CRC: 2430907151 Xref: news.eternal-september.org comp.lang.ada:27310 Date: 2015-08-01T16:39:16-07:00 List-Id: On Sunday, August 2, 2015 at 12:44:46 AM UTC+2, Jeffrey R. Carter wrote: > On 08/01/2015 01:44 PM, EGarrulo wrote: > > > > if Some_Condition then > > -- Call operations of Singleton_Package > > end if; > > > > translates directly to C++: > > > > if (some_condition) { > > // Call static operations of Singleton_Class. > > } > > > > Where is the difference? I don't see any. > > > > Actually, I don't see anything esoteric about Ada packages. I have insisted on > > a Get_Instance function because otherwise the Singleton pattern wouldn't be any > > different from global variables (or static class members). > > Here you've lost me again. A singleton is some hidden state and some operations > that use that state. It is more than that. The "Applicability" for the Singleton patterns requires that "the sole instance should be extensible by sub-classing, and clients should be able to use an extended instance without modifying their code." In other words: if you don't need sub-classing, then you don't need the complications of the Singleton pattern.