#What're the differences between a userdata returned by newproxy() and a table?

1 messages · Page 1 of 1 (latest)

clever niche
#

I think the title is pretty clear, I'm wondering what the key differences are.

native bobcat
#

There almost the same the main difference is there type

#

If you do
type()
One will return userdata
The other will return table

#

This has some knock on effects
For instance
If you do
table.insert(userdata) this will not work
But if you do
table.insert(table) this will work fine

#

Also by default if you did
userdata.key = value this will give an error where with a table it will not give a error

clever niche
#

So to make dot access work would I use a metatable with __index and __newindex?

clever niche
#

Nicu

clever niche
#

Quick question @native bobcat, in your DataStoreModule, does __shared actually do anything or is it just a stylistic decision to try and make it more clear that anything in __shared is passed by reference?