summaryrefslogtreecommitdiff
path: root/scratch/new_index.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scratch/new_index.lua')
-rw-r--r--scratch/new_index.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/scratch/new_index.lua b/scratch/new_index.lua
new file mode 100644
index 0000000..3aa6a91
--- /dev/null
+++ b/scratch/new_index.lua
@@ -0,0 +1,9 @@
+
+local t = setmetatable({}, {
+ __newindex = function(t, k, v)
+ print(t, k, v)
+ end
+})
+
+-- table.insert(t, "hello")
+t[1] = "hello"