Singleton: Difference between revisions
m
→{{header|Julia}}: an older version 0.4 version syntax example got marked as incorrect, so updated.
m (→{{header|Julia}}: an older version 0.4 version syntax example got marked as incorrect, so updated.) |
|||
Line 1,140:
=={{header|Julia}}==
Julia allows singletons as type declarations without further specifiers. There can be only one instance of such a type, and if more than one variable is bound to such a type they are actually all bound to the same instance in memory:
<lang julia>
x = IAmaSingleton()
|