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: border1.nntp.ams.giganews.com!nntp.giganews.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Generics vs. O-O? Date: Fri, 02 Aug 2013 10:00:30 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <6238c325-79c5-4537-ba55-2800110dc6df@googlegroups.com> <1wugpqyea6s39$.e2e8eshup5wn$.dlg@40tude.net> <51fadf40$0$6557$9b4e6d93@newsspool4.arcor-online.net> <15qso6tlt3uf1.h45wqc019b00$.dlg@40tude.net> <51fb80d8$0$6561$9b4e6d93@newsspool4.arcor-online.net> <1so729qnkrrj2.ztrxvmlw6cb7.dlg@40tude.net> <8bef1dc4-547b-478e-b81a-09077212f821@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 2 Aug 2013 16:53:58 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="194df0738b6f7da39154e0dc362e454f"; logging-data="8209"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189anH3SJHjJEo5kCC2NOC9vyNfv4naNtw=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: Cancel-Lock: sha1:MfGUbWK/22PdXcVLn+68UBe8CCw= Xref: number.nntp.dca.giganews.com comp.lang.ada:182819 Date: 2013-08-02T10:00:30-07:00 List-Id: On 08/02/2013 08:36 AM, Alan Jump wrote: > > This is going off on a bit of a tangent, but as a new student of the > language, I think a case could be made that many stand-alone packages or > procedures in Ada are singletons, simply because of Ada's inherent strong > typing. After all, what's a singleton? By definition, to be a singleton > pattern, two criteria must be met: one and only one instance with a global > point of access, and initialization on first use. (Source: > http://sourcemaking.com/design_patterns/singleton) Right. The "singleton type" is a kludge from languages that confuse the concepts of type and module. In Ada, which properly separates these concepts, a singleton is simply a package. -- Jeff Carter "You me on the head hitted." Never Give a Sucker an Even Break 108