Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Singleton/Epoxy/singleton.epoxy
Normal file
24
Task/Singleton/Epoxy/singleton.epoxy
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
fn Singleton()
|
||||
if this.self then return this.self cls
|
||||
var new: {}
|
||||
iter k,v as this._props do
|
||||
new[k]:v
|
||||
cls
|
||||
this.self:new
|
||||
return new
|
||||
cls
|
||||
Singleton._props: {
|
||||
name: "Singleton",
|
||||
fn setName(self,new)
|
||||
self.name:new
|
||||
cls,
|
||||
}
|
||||
|
||||
var MySingleton: Singleton()
|
||||
log(MySingleton == Singleton()) --true
|
||||
log(MySingleton.name) --Singleton
|
||||
|
||||
var NewSingleton: Singleton()
|
||||
NewSingleton>>setName("Test")
|
||||
|
||||
log(MySingleton.name) --Test
|
||||
Loading…
Add table
Add a link
Reference in a new issue