01 2017 档案
摘要:--[[---------------------------------------------------------------------------- --@ Descrption: 属性节点类库 --@ Changes: -------------------------------------------------------------------------------]...
阅读全文
摘要:背景 在一个lua文件中书写的代码, 使用的变量, 需要设置其运行环境。 目的: 1、 不破坏全局环境。 2、 限定文件所使用的环境, 作为沙箱功能。 解法 限定运行空间环境的文件: 加载上个文件的代码 (将dmenu的值,传入上个文件, 并限定只能在全局环境中读取):
阅读全文
摘要:函数链 http://lua-users.org/wiki/FiltersSourcesAndSinks A chain is a function that combines the effect of two (or more) other functions, but whose interf
阅读全文
摘要:背景 不同文件中,lua提供模块写法, 使用local修饰,可以将变量或者函数,声明为模块内有效,例如 模块暴漏变量使用 return 表的方式。 这样能够避免不同文件中, 存在相同函数或者变量名, 污染全局环境问题, 也解决的命名冲突问题。 但是存在一种情况, 在同一个文件内, 存在函数同名情况,
阅读全文
摘要:背景 见上一篇。 面向对象的链式调用中,掺杂了 一个一部动作, 对于这种工作链, 是非同步执行的链。 LazyMan("Hank").sleep(1).eat("dinner") 同步执行的工作链中, 任何一个动作,即函数调用, 都是同步的, 可理解为普通的函数。 异步的工作链, 前提条件是工作链中
阅读全文
摘要:LazyMan问题与解法 http://mp.weixin.qq.com/s/drNGvLZddQztcUzSh8OsSw 给出了一道题目,并给出了解法: 题目: 实现一个LazyMan,可以按照以下方式调用: LazyMan(“Hank”)输出: Hi! This is Hank! LazyMan
阅读全文
摘要:ReactiveX http://reactivex.io/ An API for asynchronous programmingwith observable streams The Observer pattern done right ReactiveX is a combination o
阅读全文
摘要:https://en.wikipedia.org/wiki/Aspect-oriented_programming Action Agent-oriented Array-oriented Automata-based Concurrent computing Relativistic progra
阅读全文
摘要:AOP https://en.wikipedia.org/wiki/Aspect-oriented_programming Typically, an aspect is scattered or tangled as code, making it harder to understand and
阅读全文
摘要:luaunit Luaunit is a unit-testing framework for Lua, in the spirit of many others unit-testing framework. Luaunit let's you write test functions, test
阅读全文
摘要:Diet Food Diet (nutrition), the sum of the food consumed by an organism or group Dieting, the deliberate selection of food to control body weight or n
阅读全文