RosettaCodeData/Task/Singleton/Lasso/singleton-1.lasso
2016-12-05 23:44:36 +01:00

17 lines
321 B
Text

// Define the thread if it doesn't exist
// New definition supersede any current threads.
not ::serverwide_singleton->istype
? define serverwide_singleton => thread {
data public switch = 'x'
}
local(
a = serverwide_singleton,
b = serverwide_singleton,
)
#a->switch = 'a'
#b->switch = 'b'
#a->switch // b