# Path: luna/luaframe.py
# class LuaBuiltinFrame(LuaFrame):
#     def __init__(self, function):
#         self.function = function
#         self.registers = []
# 
#     def call(self, args, space):
#         return self.function(args)
# 
#     def clone(self):
#         # no need to cleon, LuaBuilinFrame has no state
#         return self
# 
# Path: luna/w_objects.py
# class W_Table(W_Object):
#     def __init__(self):
#         self.content = {}
# 
#     def size(self):
#         return len(self.content)
# 
#     def get(self, key):
#         try:
#             w_v = self.content[key.hash()]
#             assert isinstance(w_v, W_Object)
#             return w_v
#         except KeyError:
#             return W_Pri(0)
# 
#     def set(self, key, val):
#         self.content[key.hash()] = val
# 
#     def clone(self):
#         # TODO: deep copy expceted here?
#         cpy = W_Table()
#         cpy.content = self.content.copy()
#         return cpy
# 
#     def hash(self):
#         return compute_identity_hash(self.content)
# 
#     def values(self):
#         return self.content.values()
# 
#     def items(self):
#         return self.content.items()
# 
# class W_Str(W_Object):
#     def __init__(self, val):
#         self.s_val = val
# 
#     def getval(self):
#         return self.s_val
# 
#     def eq(self, w_other):
#         if isinstance(w_other, W_Str):
#             return self.s_val == w_other.getval()
#         else:
#             assert isinstance(w_other, W_Pri)
#             if w_other.n_val == 0:
#                 return self.s_val is None
#             else:
#                 assert 0
# 
#     def neq(self, w_other):
#         return not self.eq(w_other)
# 
#     def gt(self, w_other):
#         assert isinstance(w_other, W_Str)
#         return self.s_val > w_other.s_val
# 
#     def lt(self, w_other):
#         assert isinstance(w_other, W_Str)
#         return self.s_val < w_other.s_val
# 
#     def le(self, w_other):
#         assert isinstance(w_other, W_Str)
#         return self.s_val <= w_other.s_val
# 
#     def ge(self, w_other):
#         assert isinstance(w_other, W_Str)
#         return self.s_val >= w_other.s_val
# 
#     def to_str(self):
#         return str(self.s_val)
# 
#     def clone(self):
#         return W_Str(self.s_val)
# 
#     def hash(self):
#         return compute_hash(self.s_val)


from luna.luaframe import LuaBuiltinFrame
from luna.w_objects import W_Table, W_Str


class ModuleDef(object):
    def __init__(self, name):
        self.name = name
        self.methods = W_Table()

    def function(self, name):
        def adder(func):

# Path: luna/luaframe.py
# class LuaBuiltinFrame(LuaFrame):
#     def __init__(self, function):
#         self.function = function
#         self.registers = []
# 
#     def call(self, args, space):
#         return self.function(args)
# 
#     def clone(self):
#         # no need to cleon, LuaBuilinFrame has no state
#         return self
# 
# Path: luna/w_objects.py
# class W_Table(W_Object):
#     def __init__(self):
#         self.content = {}
# 
#     def size(self):
#         return len(self.content)
# 
#     def get(self, key):
#         try:
#             w_v = self.content[key.hash()]
#             assert isinstance(w_v, W_Object)
#             return w_v
#         except KeyError:
#             return W_Pri(0)
# 
#     def set(self, key, val):
#         self.content[key.hash()] = val
# 
#     def clone(self):
#         # TODO: deep copy expceted here?
#         cpy = W_Table()
#         cpy.content = self.content.copy()
#         return cpy
# 
#     def hash(self):
#         return compute_identity_hash(self.content)
# 
#     def values(self):
#         return self.content.values()
# 
#     def items(self):
#         return self.content.items()
# 
# class W_Str(W_Object):
#     def __init__(self, val):
#         self.s_val = val
# 
#     def getval(self):
#         return self.s_val
# 
#     def eq(self, w_other):
#         if isinstance(w_other, W_Str):
#             return self.s_val == w_other.getval()
#         else:
#             assert isinstance(w_other, W_Pri)
#             if w_other.n_val == 0:
#                 return self.s_val is None
#             else:
#                 assert 0
# 
#     def neq(self, w_other):
#         return not self.eq(w_other)
# 
#     def gt(self, w_other):
#         assert isinstance(w_other, W_Str)
#         return self.s_val > w_other.s_val
# 
#     def lt(self, w_other):
#         assert isinstance(w_other, W_Str)
#         return self.s_val < w_other.s_val
# 
#     def le(self, w_other):
#         assert isinstance(w_other, W_Str)
#         return self.s_val <= w_other.s_val
# 
#     def ge(self, w_other):
#         assert isinstance(w_other, W_Str)
#         return self.s_val >= w_other.s_val
# 
#     def to_str(self):
#         return str(self.s_val)
# 
#     def clone(self):
#         return W_Str(self.s_val)
# 
#     def hash(self):
#         return compute_hash(self.s_val)


# Path: luna/module.py
from luna.luaframe import LuaBuiltinFrame
from luna.w_objects import W_Table, W_Str



class ModuleDef(object):
    def __init__(self, name):
        self.name = name
        self.methods = W_Table()

    def function(self, name):
        def adder(func):

            self.methods.set(W_Str(name), LuaBuiltinFrame(func))