-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtbtest2.lua
More file actions
60 lines (47 loc) · 824 Bytes
/
tbtest2.lua
File metadata and controls
60 lines (47 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
local ptb = require 'lib/ptb'
local data = {
wifeinfo={
exp=263425,
glamour=1500,
intimacy=607,
mother=2001
},
adultinfo={
aa=263425,
bb=1500,
cc=607,
dd=2001
},
child={
ee=263425,
ff=1500,
gg=607,
hh=2001
},
}
print("=========")
ptb:p(data.wifeinfo)
local tmpinfo = data.wifeinfo
data.wifeinfo.mother=101
print("=========")
ptb:p(data.wifeinfo)
print("===引用跟着变=====")
ptb:p(tmpinfo)
tmpinfo.exp=1
print("=========")
ptb:p(tmpinfo)
print("======引用跟着变======")
ptb:p(data.wifeinfo)
local mother = data.wifeinfo.mother
mother=20
print("=========")
ptb:p(mother)
print("===不变======")
ptb:p(data.wifeinfo)
print("============")
tmpinfo = {aa=1,bb=2,cc=3}
ptb:p(tmpinfo)
print("===整体替换不变======")
ptb:p(data.wifeinfo)
print("============")
ptb:p(data)