News for hackers. Stuff that matters.
Re:Lua, a Misunderstood Language by djur on Friday January 15, 2021 @11:48PM (#25800131)
Lua has a type of value called "userdata" that is just an opaque reference to a C resource. There's no way for Lua to know how do a deep copy of that resource, if it's possible at all. Tables can also have "metatables" that modify how they function. It's not obvious whether a deep copy should also create a deep copy of the metatable (and its metatable, and so on) or whether the copy should share the original metatable. There's good arguments either way.

There are no comments on this comment yet.