summaryrefslogtreecommitdiffhomepage
path: root/zh-cn
diff options
context:
space:
mode:
authorGeoff Liu <cangming.liu@gmail.com>2016-01-20 15:17:09 -0700
committerGeoff Liu <cangming.liu@gmail.com>2016-01-20 15:17:09 -0700
commit9a5bb286686f5dd4fb743c1bd15ad70a3c6a4a3f (patch)
treee7b7c03e39001764836120db924fcd64ddbdd3a9 /zh-cn
parent5477929e8e3c1990c046f245b1e59dbc9df92b45 (diff)
parent39825e459f11f8c59d0f39afa6418ad1332ec3a4 (diff)
Merge pull request #2109 from qinhanlei/patch-1
Update lua-cn.html.markdown
Diffstat (limited to 'zh-cn')
-rw-r--r--zh-cn/lua-cn.html.markdown6
1 files changed, 3 insertions, 3 deletions
diff --git a/zh-cn/lua-cn.html.markdown b/zh-cn/lua-cn.html.markdown
index 098d0ab5..fc0375f5 100644
--- a/zh-cn/lua-cn.html.markdown
+++ b/zh-cn/lua-cn.html.markdown
@@ -210,7 +210,7 @@ f2 = {a = 2, b = 3}
metafraction = {}
function metafraction.__add(f1, f2)
- sum = {}
+ local sum = {}
sum.b = f1.b * f2.b
sum.a = f1.a * f2.b + f2.a * f1.b
return sum
@@ -273,7 +273,7 @@ eatenBy = myFavs.animal -- 可以工作!感谢元表
Dog = {} -- 1.
function Dog:new() -- 2.
- newObj = {sound = 'woof'} -- 3.
+ local newObj = {sound = 'woof'} -- 3.
self.__index = self -- 4.
return setmetatable(newObj, self) -- 5.
end
@@ -307,7 +307,7 @@ mrDog:makeSound() -- 'I say woof' -- 8.
LoudDog = Dog:new() -- 1.
function LoudDog:makeSound()
- s = self.sound .. ' ' -- 2.
+ local s = self.sound .. ' ' -- 2.
print(s .. s .. s)
end