Jump to content

Singleton: Difference between revisions

Added zkl
(→‎{{header|Lasso}}: Singleton Examples)
(Added zkl)
Line 1,507:
}
}</lang>
 
=={{header|zkl}}==
A class declared static only has one instance, ever. However, a class with the same name & structure could be created in another scope.
<lang zkl>class [static] Borg{ var v }
b1 := Borg; b2 := Borg();
b1 == b2 //--> True
b1.v=123; b2.v.println(); //--> 123</lang>
 
{{omit from|AWK}}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.