> t = Set{'cat', 'dog'} > > seems short enough and very readable Or simply t = Set'cat, dog' where function Set(s) local t={} for k in s:gmatch("%w+") do t[k]=true end return t end Adapt the pattern "%w+" as needed.