How can a access a variable name using a string and concatination
snippet in lua

How can a access a variable name using a string and concatination

user574

local archetypes = { meleeNames = { x, y, z },
                     ... others }
local archetype = "melee"

if itemNumber > #archetypes[archetype .. "Names"] then
  itemNumber = #archetypes[archetype .. "Names"]
end