this is what a deep copy function is supposed to look like, right? i'm not forgetting something obvious?
@shoofle
Looks conceptually right, but some implementation questions:
What language is this?
Does your language have any notion of types? Looking for [table] as a string is sketchy. What if your value is the literal string [table]?
If you have an array, is the "return other" going to return a copy of the array, or a reference?
this is what a deep copy function is supposed to look like, right? i'm not forgetting something obvious?
@shoofle
I suspected lua. Lua is pretty cool!
It can easily be confused with javascript, especially when you have to deal with them both.
Except lua is actually nice under the hood! 😅
Looking up lua specific examples, you still have corner cases If your table is cyclical or recursive. Also you haven't covered metatable copying.
But I suspect you don't require these features today.