caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Hendrik Tews <tews@tcs.inf.tu-dresden.de>
To: "Caml-List" <caml-list@inria.fr>
Subject: Re: [Caml-list] How to implement  "Singleton" design pattern?
Date: Mon, 5 Aug 2002 11:28:33 +0200 (CEST)	[thread overview]
Message-ID: <15694.17729.991123.603983@gargle.gargle.HOWL> (raw)
In-Reply-To: <002d01c23aae$b44a6490$fe00a8c0@hama>

SooHyoung Oh writes:
   Date: Sat, 3 Aug 2002 14:29:13 +0900
   Subject: [Caml-list] How to implement  "Singleton" design pattern?
   
   And then how can we solve the (1)?
   
   There are some possible solutions:
   (a) invisible class definition in a module
   (b) the class definition which can't be called with "new" (private class ?)
   (c) local class definition (in another class definition ?)
   
   Which one/ones is/are feasible and/or good in Ocaml?
   And are there any other solutions?
   
If it is enough to detect the error at runtime:
You can use an initializer that raises an exception if a second
object is created. 

Bye,

Hendrik
-------------------
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


  parent reply	other threads:[~2002-08-05  9:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-03  5:29 SooHyoung Oh
2002-08-03 17:42 ` Tim Freeman
2002-08-05  9:28 ` Hendrik Tews [this message]
2002-08-05 17:48 Gurr, David (MED, self)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15694.17729.991123.603983@gargle.gargle.HOWL \
    --to=tews@tcs.inf.tu-dresden.de \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).