您的位置:首页 > 编程语言 > Lua

Self Summary: Lua Language(two useful links) and the difference between : and .

2016-03-09 10:48 316 查看
Here is a very useful website about learning Lua: http://tylerneylon.com/a/learn-lua/

Also, here is a detailed teaching link: http://www.lua.org/pil/contents.html

Here I just want to talk about the difference of : and . in Lua: 

Function tablename:fn(...) is the same as function tablename.fn(self, ...). The : just adds a first arg called self.

Class behaviour is built upon the basis of table in Lua. For details please turn to the website. 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  lua object programming