Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
17
Task/Singleton/Lasso/singleton-1.lasso
Normal file
17
Task/Singleton/Lasso/singleton-1.lasso
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// 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
|
||||
16
Task/Singleton/Lasso/singleton-2.lasso
Normal file
16
Task/Singleton/Lasso/singleton-2.lasso
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Define thread level singleton
|
||||
|
||||
define singleton => type {
|
||||
data public switch = 'x'
|
||||
public oncreate => var(.type)->isa(.type) ? var(.type) | var(.type) := self
|
||||
}
|
||||
|
||||
local(
|
||||
a = singleton,
|
||||
b = singleton,
|
||||
)
|
||||
|
||||
#a->switch = 'a'
|
||||
#b->switch = 'b'
|
||||
|
||||
#a->switch // b
|
||||
Loading…
Add table
Add a link
Reference in a new issue