Skip to content

Instantly share code, notes, and snippets.

View Frityet's full-sized avatar
😁
I LOVE LUA! ❤️

Frityet

😁
I LOVE LUA! ❤️
View GitHub Profile
local interface Animal
-- Associated function signature; `Self` refers to the implementor type.
new: function(string): self
-- Method signatures; these will return a string.
name: function(self): string
noise: function(self): string
talk: function(self)
end
local record Sheep
_naked: boolean
_name: string
__index: Sheep
end
Sheep.__index = Sheep
-- impl Sheep
function Sheep:shear()
print(self._name, "gets a haircut!");