This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: metaclass <singleton>
- To: Klaus dot Schilling at munich dot netsurf dot de
- Subject: Re: metaclass <singleton>
- From: Miroslav Silovic <silovic at zesoi dot fer dot hr>
- Date: 25 Sep 1999 21:39:47 +0200
- Cc: guile at sourceware dot cygnus dot com
- References: <m11V24A-000H3wC@debian>
Klaus Schilling <Klaus.Schilling@munich.netsurf.de> writes:
> Is it possible to create a singleton metaclass using the MOP
> of goops?
> At most one instance is allowed to exist simultaneously, but
> how may one detect whether previously created instances have
> been garbage collected or at least dropped all strong references
> already?
The problem is that you don't have a guarantee that an instance will
be gc'ed once nothing uses it - it may even be that all strong
references are dropped but the instance remains alive due to
conservative GC biting you.
One way to do this is to allow an instance to be 'deactivated'
explicitely - set some flag on it on 'inactive' and throw error on all
subsequent method invocation attempts.
--
How to eff the ineffable?