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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,842accb6a7d76669 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-06 08:44:39 PST Path: archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!ppp-2-177.cvx5.telinco.NET!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: List container strawman 1.1 Date: Tue, 6 Nov 2001 16:42:02 -0000 Message-ID: <9s941i$11mrei$3@ID-25716.news.dfncis.de> References: NNTP-Posting-Host: ppp-2-177.cvx5.telinco.net (212.1.153.177) X-Trace: fu-berlin.de 1005065075 35352018 212.1.153.177 (16 [25716]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: archiver1.google.com comp.lang.ada:15924 Date: 2001-11-06T16:42:02+00:00 List-Id: "Eric Merritt" wrote in message news:mailman.1005002950.9554.comp.lang.ada@ada.eu.org... > A singleton is a generally an object of which there is > only one instance throughout the entire application. > That means that accessed from anywhere in the program > it will return the same list, in effect it is only > instantiated once. That instance is then returned any > time a new list is called for. So any elements added > to the list are available thought the application. > Basically a Singleton is a single instance of an > object, ie there can never be more then one instance > singleton object in an application. That may be the meaning other languages, but not Ada! I intended the word ('singleton') in the mathematical sense of a set with only one element. Okay so we're not talking about a set, but a list, but I think the meaning is fairly obvious. In a program, code such as: Team(England,Jumping,Ladies) := Singleton(HRH_Princess_Anne); would help to emphasise that a list was being constructed that comprised only one element. It would contrast usefully, I think, with a multiple constructor: Team(USA,TF_Relay_4x400m,Men) := To_List((Alvin_Harrison, Antonio_Pettigrew, Calvin_Harrison, Michael_Johnson)); Of course, one alternative is not to have a 'singleton' constructor. It's only a convenience: Team(England,Jumping,Ladies) := To_List((1 => HRH_Princess_Anne)); I think I'd prefer having it, though. -- Nick Roberts