-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdont.lua
More file actions
59 lines (52 loc) · 973 Bytes
/
Copy pathdont.lua
File metadata and controls
59 lines (52 loc) · 973 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
-- l={
-- p=1,p2=10,
-- }
-- function l:f()
-- p=0
-- print(p)
-- p=p+1
-- end
-- l.f()
-- o=coroutine.create(function()
-- -- p=0
-- -- print(p)
-- -- p=p+1
-- -- io.write(p)
-- i=0
-- while true do
-- print(i)
-- print("s")
-- i=i+1
-- coroutine.yield(i)
-- end
-- end)
-- -- print(coroutine.status(o))
-- coroutine.resume(o)
-- -- print(coroutine.status(o))
-- coroutine.resume(o)
-- coroutine.resume(o)
-- coroutine.resume(o)
-- coroutine.resume(o)
-- coroutine.resume(o)
-- coroutine.resume(o)
obj1={var=13}
obj2={var=1}
meta={
__index = obj1
}
print(obj2.var)
setmetatable(obj2,meta)
print(obj2.var)
------------------
objeto={}
objeto.prototype={a=1,b=10}
objeto.metetable={__index=objeto.prototype,__call=function(t)
return t.a.." = "..t.b
end}
objeto.new=function(o)
local i=o
setmetatable(i,objeto.metetable)
return i
end
inst=objeto.new({a=2,b=90})
print(inst())