mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-24 08:01:05 +00:00
20 lines
364 B
Plaintext
20 lines
364 B
Plaintext
let object = {
|
|
__setter = [
|
|
"field1" = func(self, val)
|
|
print("setter for field1 called!")
|
|
self.x = val
|
|
end
|
|
],
|
|
|
|
__getter = [
|
|
"field1" = func(self)
|
|
print("getter for field1 called!")
|
|
|
|
return self.x + 1
|
|
end
|
|
]
|
|
}
|
|
|
|
object.field1 = 1337
|
|
|
|
print("got field: " .. object.field1) |