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,UTF8 Received: by 10.68.136.40 with SMTP id px8mr1737940pbb.1.1329226436083; Tue, 14 Feb 2012 05:33:56 -0800 (PST) X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.181.72 Path: wr5ni24123pbc.0!nntp.google.com!news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!nntpfeed.proxad.net!78.192.181.72.MISMATCH!gegeweb.42!gegeweb.eu!usenet.pasdenom.info!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 14:33:43 +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="utf-8" Content-Transfer-Encoding: 8bit Date: 2012-02-14T14:33:43+01:00 List-Id: On Tue, 14 Feb 2012 10:08:37 +0100, Yannick Duchêne (Hibou57) wrote: > Le Mon, 13 Feb 2012 22:02:17 +0100, Dmitry A. Kazakov > a écrit: >>> About package holding singleton really holding singleton, like say a Log >>> package which would create a singleton file "Log.File" objct, I believe >>> that's not good for re‑usability (ex. what about multiple task?). Better >>> provide a type with a constructor, >> >> Constructor = constructor or constructor = constructing function? The >> latter is bad design. > I never get into trouble with this. If I am likely to get into troubles > with it, I would like to know before it happens and have a chance to > prevent it before, obviously. On the mean time, I'm not a big tagged type > user, and feel to understand your objections to it, mainly applies to > tagged types hierarchies. You may have a constructor for a singleton type because constructor cannot be called explicitly and you cannot get rid of the constructor anyway. The constructor is generated by the compiler (except for misuses of the pragma Import (Ada, etc). You shall never provide a constructing function (=factory) for singleton types. A factory can be used several times, which you, as a package provider, cannot control. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de