title: Can i make a function to create table and name it with a parameter used when called?
body: <p>I'm trying to make a function that, when I call it, I can pass it a name and it will make a table for me. I then want it to return the table so I can use it. My code does make a table but I can't seem to access it. I'm thinking Lua is having trouble naming after an argument, but I'm not sure how to fix it. Here is a sample code of what I am trying to accomplish:</p>
  
  <p><strong>Tablemaker.lua:</strong></p>
  
  <pre><code>Tabler = {}
  Tabler.init = function (n,x,y,z)
  --This is where i think it is messing up
      N = {}
      N.a = x
      N.b = y
      N.c = z
      --had a print function here so i know the table is made.
      I am leaving it out for you guys.
      --not sure if i need it but i put return here.
      Return n
  End
  </code></pre>
  
  <p><strong>Main.lua:</strong></p>
  
  <pre><code>Require ("Tablemaker.lua")
  
  Tabler.init (meow,15,32,45)
  --a sepaeate print function here to verify i can access my
  table. When the console tries to print, it gives meow = nil.
  Which i am assuming the table is not properly named meow and
  is instead named n. However using print(n.a) for example gives
  n = nil also.
  Print(meow.a .. " " .. meow.b .. " " .. meow.c)
  </code></pre>
  
  <p>And thats about it. I'm trying to make a vector class (not sure why one isn't in Lua), but even without vectors I want to be able to pass names into functions. What should i do?</p>