Hacker News new | ask | show | jobs
by DayDollar 1414 days ago
In many scripting languages this is not the case, and you are ever only passing around references. Python comes to mind.

Lots of people obviously have a problem with this as it deeply different from the algebra derived assignment syntax.

local a = b creates a local copy, but even then, its not a deepcopy, containing references to other tables.

2 comments

python has both .copy() methods and a copy module. That's not to highlight Python's strengths, but an indication that it's a complex topic in Python - it has footguns here. The copy module might even do the wrong thing for a given object.
The algebra-derived assignment syntax kind of falls apart with mutation anyway.