func initializeProxies(L *lua.State) { add_index := func(name string, fun lua.GoFunction) { L.PushGoCallback(fun) L.SetField(-2, name) } flagValue := func() { L.PushBoolean(true) L.SetField(-2, "luago.value") L.Pop(1) } L.NewMetaTable(SLICE_META) add_index("__index", slice__index) add_index("__newindex", slice__newindex) add_index("__len", slicemap__len) flagValue() L.NewMetaTable(MAP_META) add_index("__index", map__index) add_index("__newindex", map__newindex) add_index("__len", slicemap__len) flagValue() L.NewMetaTable(STRUCT_META) add_index("__index", struct__index) add_index("__newindex", struct__newindex) flagValue() L.NewMetaTable(INTERFACE_META) add_index("__index", interface__index) flagValue() L.NewMetaTable(CHANNEL_META) //~ RegisterFunctions(L,"*",FMap { //~ "Send":channel_send, //~ "Recv":channel_recv, //~ }) L.NewTable() L.PushGoFunction(channel_send) L.SetField(-2, "Send") L.PushGoFunction(channel_recv) L.SetField(-2, "Recv") L.SetField(-2, "__index") flagValue() }