lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Sep 28, 2012 at 7:08 AM, Rena <hyperhacker@gmail.com> wrote:
> require("bread", "butter", "jelly")

It's not a difficult function to write:

function nrequire(...)
   local args = {...}
   for i,mod in ipairs(args) do
      args[i] = require(mod)
   end
  return unpack(args)
end

And its module could be organized so that you could say:

local bread,butter,jelly = require 'multi' ('bread','butter','jelly')

(Yes, require() _can_ return multiple values but that's rather unusual)

steve d.