Singleton: Difference between revisions
Content deleted Content added
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}}==
|