3 ms·
It looks like everything is passed by value, so instead of passing a reference to that int, string, list, array, etc, you are always passing a copy. Once you hi
by SoftwareMaven 15y ago
It looks like everything is passed by value, so instead of passing a reference to that int, string, list, array, etc, you are always passing a copy. Once you hit an evaluation contact above where the copy cane from, it can be deleted.
I would imagine for some particular set of data (many large arrays and such) that this could get really slow, but their claim is, at least in the general case, it is faster to copy everything.
- praptak 15y agoThey also provide mechanisms to pass by reference. Default pass-by-copy with specially enabled pass-by-reference is indeed the opposite from most other languages do. I wonder how this interacts with things like memory paging and CPU cache.
- _delirium 15y agoDefault pass-by-copy with specially enabled pass-by-reference isn't that uncommon; it's how C++ works, for example.