summaryrefslogtreecommitdiff
path: root/test/trace.lua
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2000-11-06 12:00:00 +0000
committerrepogen <>2000-11-06 12:00:00 +0000
commit8cb71cb5548e3138e5d4e4744f52c79d9fafb116 (patch)
tree25859eb162c67eafc46866e0ec3a9a7ebf93157a /test/trace.lua
parentb7610da5fed99f59ac73ae452da8839a0f2c1bda (diff)
downloadlua-github-4.0.tar.gz
Lua 4.04.0
Diffstat (limited to 'test/trace.lua')
-rw-r--r--test/trace.lua33
1 files changed, 0 insertions, 33 deletions
diff --git a/test/trace.lua b/test/trace.lua
deleted file mode 100644
index 5f32a8f9..00000000
--- a/test/trace.lua
+++ /dev/null
@@ -1,33 +0,0 @@
--- shows how to trace assigments to global variables
-
-T=newtag() -- tag for tracing
-
-function Ttrace(name) -- trace a global variable
- local t={}
- settag(t,T)
- rawsetglobal(name,t)
-end
-
-function Tsetglobal(name,old,new)
- write("tracing: ",name," now is ",new,"\n")
- old.value=new
-end
-
-function Tgetglobal(x,value) -- get the actual value
- return value.value
-end
-
-settagmethod(T,"getglobal",Tgetglobal)
-settagmethod(T,"setglobal",Tsetglobal)
-
--- now show it working
-
-Ttrace("a")
-Ttrace("c")
-
-a=1
-b=2
-c=3
-a=10
-b=20
-c=30