title: Lua table/list string cast/concat
body: <p>Is there any method more efficient but simpler as the <em>anonymous function</em> use, when casting a list (<em>A table with only one level</em>) to string?</p>
  
  <p>Why asking this? I Have heard that the string concatenation over and over in Lua is <strong>memory inefficient</strong> because Lua strings are immutable objects that have to be thrown to the garbage collector once used.</p>
  
  <p>So with <strong>anonymous function usage</strong> I mean this:</p>
  
  <pre class="lang-lua prettyprint-override"><code>local resources = {
      ["bread"] = 20,
      ["meat"] = 5,
      ["something"] = 99
  };
  
  local function getTheText()
      return "Resources:\n"..
          ( (function()
               local s = "";
               for k, v in pairs(resources) do
                   s = s.."\n\t"..k..": "..v.." units.";
               end
               return s;
          )())..
          "\nMore awesome info...";
     end
  end
  </code></pre>
  
  <p>You know, for this time I could use <strong>a metafunction</strong> like a <em>tostring</em> on this table because it is not going to change, but if I use other <strong>anonymous tables</strong> I will not have this option.</p>
  
  <p>Anyway I love the anonymous usage of functions so, it is not a problem for me.</p>
  
  <hr>
  
  <p>Is there anything more efficient that does <strong>not</strong> require declaring functions? and is this more or less efficient than using a metamethod?</p>