OpenTTD AIs and Game Scripts • Re: nasal demons in action
This is a fairly common approach to passing arguments in languages that don't distinguish between references and values. Essentially, every argument pass is done by reference, and if a value is needed, it has to be made explicitly. It works this way in Perl, Lua, and, apparently, squirrel. And thousands of other languages as well.
You will need to make a deep copy of the container you want a copy from, assuming you truly, actually, really want a copy. You probably don't. Making deep copies is not a straightforward problem, mostly because a generic copy-making algorithm does not know whether a given field of a complex data structure is to be copied or not. Usually, the language provides some serialization support - but using it within the specifics of a given problem is up to the programmer.
Statistics: Posted by uzurpator — 28 Feb 2026 20:50
Discussion in the ATmosphere