librime-lua
librime-lua copied to clipboard
MemoryReg 異動
-
Memory() 初始化增加 argv[4] callback_func https://github.com/hchunhui/librime-lua/blob/01c61b1d12ff5fb31711b150ad075422e1d7106d/sample/lua/expand_translator.lua#L30-L35
-- ex1 env.mem = Memory(env.engne,env.engine.schema) env.mem:memorize( callback_func) -- callback_func -- ex2 env.mem = Memory(env.engne,env.engine.schema, 'translator',callback_func) -
memoize(func) 直接 callback 免去 function(commit) return callback_func end https://github.com/hchunhui/librime-lua/blob/754aaf4c6a515cdc34ebd2ba35ffb778750e92dc/src/types.cc#L1343
auto r = lua_->call<bool, an<LuaObj>, T &, const CommitEntry &>(memorize_callback, *this, commit_entry); -
lookup func return an
可以同時產生多組 iter 組合應用 -
增加 DictEntryIterReg UserDictEntryIterReg 配合 第四項