moonscript: A programmer friendly language that compiles to Lua.
MoonScript is a dynamic scripting language that compiles into Lua. It gives you the power of one of the fastest scripting languages combined with a rich set of features.
最近在研究 lua。文档看了一大半。越往后看,越觉得地球人已经无法阻止该语言的发明者偷懒了。
有兴趣的童鞋可以关注一下,只是稍稍有点不喜他这个靠严格缩进来支撑的逻辑。
抄几句官网的 code:
func_a = -> for i=1,10 do i
class Inventory
new: =>
@items = {}
add_item: (name) =>
if @items[name]
@items[name] += 1
else
@items[name] = 1
真心有点叼炸天的感觉。