Jump to content

Singleton: Difference between revisions

183 bytes added ,  10 years ago
no edit summary
m (→‎{{header|Perl 6}}: syntax update)
No edit summary
Line 1,440:
Clones of Oddball themselves may not be cloned. Methods and slots may still be defined on them:
<lang slate>define: #Singleton &builder: [Oddball clone]</lang>
 
=={{header|Smalltalk}}==
<lang smalltalk>
SomeClass class>>sharedInstance
 
SharedInstance ifNil: [SharedInstance := self basicNew initialize].
^ SharedInstance
</lang>
 
=={{header|Tcl}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.