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,c39ad3e35a7690a9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.74.201 with SMTP id w9mr12849400pbv.0.1329233205125; Tue, 14 Feb 2012 07:26:45 -0800 (PST) Path: wr5ni24434pbc.0!nntp.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!194.134.4.91.MISMATCH!news2.euro.net!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Convention for naming of packages Date: Tue, 14 Feb 2012 16:26:31 +0100 Organization: cbb software GmbH Message-ID: References: <4f355230$0$21451$ba4acef3@reader.news.orange.fr> <1sx3fy79wys5s.1723nejowbg76.dlg@40tude.net> <15fgcngmgl41e$.113i7gtuwpwpv$.dlg@40tude.net> <12sbwz7m0r1qx.1pbp0ox3jr36s.dlg@40tude.net> <1nsv5nr9t05qd$.4u7741n9thcp.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Date: 2012-02-14T16:26:31+01:00 List-Id: On Tue, 14 Feb 2012 15:40:03 +0100, Yannick Duch�ne (Hibou57) wrote: > Le Tue, 14 Feb 2012 14:33:43 +0100, Dmitry A. Kazakov > a �crit: >> You shall never provide a constructing function (=factory) for singleton >> types. > It's initialized at package elaboration. A function can still be used to > return the kind of reference to the singleton. But that is either not a constructing function or else not a singleton. The former is because such a function would not return the target type. The latter is if you consider access type as a stand-alone object. In that case there could be more than one pointer objects, because you provided a way to create them by giving a factory that returns a pointer. > Lazy initialization may > also be used, while always under controle of package elaboration, which > will be the only one to set the initial value of the Inialized flag to > False. You shall not expose this implementation detail in the interface. > That said, I have a strange feeling I missed what you wanted to point. Did > I? No a point, just an almost tautological statement: singleton shall have no factory. > (yes, I finally must have missed something) Once you sorted out references from objects, public from private, constructors from factory functions... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de