Skip to content

Commit 8a240c8

Browse files
committed
Nginx高并发系统内核优化和PHP7配置文件优化
1 parent 99d9dde commit 8a240c8

File tree

7 files changed

+1204
-197
lines changed

7 files changed

+1204
-197
lines changed

Diff for: Lua-Script/function/fun001.lua

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--
2+
-- Created by IntelliJ IDEA.
3+
-- User: tinywan
4+
-- Date: 2017/7/22
5+
-- Time: 12:02
6+
-- To change this template use File | Settings | File Templates.
7+
-- [1]
8+
local function factoricall(n)
9+
if tonumber(n) == 0 then
10+
return 1
11+
else
12+
return n* factoricall(n-1)
13+
end
14+
end
15+
16+
print(factoricall(5))
17+
fun1 = factoricall
18+
print(fun1(5))
19+
20+
-- function 可以以匿名函数(anonymous function)的方式通过参数传递: anonymous
21+
local function anonymous(tab,fun)
22+
for k , v in pairs(tab) do
23+
print(fun(k,v))
24+
end
25+
end
26+
27+
tab_demo = {name = "Tinywan",age=24 }
28+
anonymous(tab_demo,function(key,value)
29+
return key .. ' = '..value
30+
end)

0 commit comments

Comments
 (0)