From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA14825; Thu, 3 Jul 2003 13:20:34 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA15126 for ; Thu, 3 Jul 2003 13:20:32 +0200 (MET DST) Received: from mail3.tpgi.com.au (mail.tpgi.com.au [203.12.160.59]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h63BKUT00837 for ; Thu, 3 Jul 2003 13:20:31 +0200 (MET DST) Received: from ozemail.com.au (syd-ts18-2600-214.tpgi.com.au [203.58.21.214]) (authenticated (0 bits)) by mail3.tpgi.com.au (8.11.6/8.11.6) with ESMTP id h63BKKd15708; Thu, 3 Jul 2003 21:20:23 +1000 Message-ID: <3F041173.8010903@ozemail.com.au> Date: Thu, 03 Jul 2003 21:20:19 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Mirko Aigner CC: caml-list@inria.fr Subject: Re: [Caml-list] prevent more than one object References: <3F0304DF.1010300@alcatel.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ozemail:01 caml-list:01 builded:01 toxteth:01 glebe:01 2037,:01 9660:01 0850:01 coerce:01 nsw:01 snail:02 wrote:03 constructor:03 object:03 shared:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Mirko Aigner wrote: > Hi ! > > I'm looking for a way to prevent that from a class more than one object > is builded. Why? Its a design error. Fix your design. There's never any need for a singleton object, because there is no resource for which there cannot be more than one. I have seen (C++) designs using singletons and they create an utter mess because someone wrongly assumed something was unique. If you want one object, define the class in your mainline, create it, and then coerce it to a shared class type which does not provide a constructor. -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners