|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
makecreates the single instance, and further attempt of creation returns the same instance.
(define-class single () () :metaclass <singleton-meta>) (define a (make single)) (define b (make single)) (eq? a b) => #t
The slots of the instance are initialized at the first invocation
make. Initargs of
make are effective only in the
fist invocation, and ignored in the subsequent invocation.
makewith the passed arguments. It is more obvious in the program that you're dealing with singleton.
<singleton-meta>. Instead of specifying
define-class, you can inherit this class to give your class the property of singleton.