local U={definitions={}}local e="\070\097\099\116\111\114\121 \037\113 \110\111\116 \100\101\102\105\110\101\100"function U.define(e,Q)U.definitions[e]=Q end function U.create(Q,...)local R=U.definitions[Q]if R==nil then error(e:format(Q))end return R(...)end return U
local M = { definitions = {} }

local ERRF_NOT_DEFINED = "Factory %q not defined"

function M.define(name, definition)
  M.definitions[name] = definition
end

function M.create(name, ...)
  local factory = M.definitions[name]

  if factory == nil then
    error(ERRF_NOT_DEFINED:format(name))
  end

  return factory(...)
end

return M
