lua-users home
lua-l archive

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


On Wed, Sep 28, 2011 at 10:10 AM, Ian Good
> Wanted to introduce ratchet, a new library

One style point: The code [1] defines modules like

  require "package"
  local common = require "ratchet.http.common"
  module("ratchet.http.server", package.seeall)
  local class = getfenv()
  __index = class
  function new(socket, from, handlers, send_size)
     local self = {}
     setmetatable(self, class)
     .....
  end

I think you can replace getfenv() here with _M.

[1] https://github.com/icgood/ratchet/blob/master/src/http/server.lua