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: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: Running a preprocessor from GPS? Date: Sat, 01 Aug 2015 19:53:47 -0700 Organization: A noiseless patient Spider Message-ID: <87twsijt8k.fsf@jester.gateway.sonic.net> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="d4217d68945dedf510265c644f2a7daa"; logging-data="12992"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vjJd1WXjNLrXLdtxqlSzs" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:sNQDQcLnkP8GWr4B9hRaYXwgOGM= sha1:RNxPC0zzqWcyb2zI3RFNT8mNY/I= Xref: news.eternal-september.org comp.lang.ada:27314 Date: 2015-08-01T19:53:47-07:00 List-Id: "Jeffrey R. Carter" writes: > Here you've lost me again. A singleton is some hidden state and some operations > that use that state. If it can be as simple as calling static operations of a > class, then why do you and the DP book insist on all the complications? If the > complications are necessary, how can it be that simple? Singleton is sort of a misnomer. It sounds like there is always exactly one instance, but it really means there is either one instance or zero instances. There are zero when the program starts, but during the program's execution it may decide to create one instance. The scheme you're describing with packages sounds like the one instance is created when the program starts. It doesn't explain how to start with zero instances, and dynamically create one later.