Skip to content

Instantly share code, notes, and snippets.

View Average-user's full-sized avatar

Lucas Polymeris Average-user

View GitHub Profile
@TannerRogalsky
TannerRogalsky / set.lua
Last active June 21, 2020 04:46
A simple set implementation in lua
local Set = {}
function Set.new()
local reverse = {}
local set = {}
return setmetatable(set, {
__index = {
insert = function(set, value)
if not reverse[value] then
table.insert(set, value)