Singleton: Difference between revisions

Content added Content deleted
(Tern Programming Language)
Line 1,140: Line 1,140:


=={{header|Julia}}==
=={{header|Julia}}==
{{incorrect|Julia|ERROR: LoadError: syntax: extra token "IAmaSingleton" after end of expression}}
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:
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>
<lang julia>