J uses reference counts on blocks, and makes a copy whenever a block is modified and there is need to keep the unmodified version.

Henry Rich

On 3/4/2020 1:14 PM, Hauke Rehr wrote:
talking about copying: I don’t remember having read about
whether J is copy-on-write or when copying will take place
is there a defined set of verbs that does copying or does
that take place at a different level?

Am 04.03.20 um 15:29 schrieb Raul Miller:
Yes.

The general case, implementated in J, would be more like

(, <@u)^:n

But, also, if side effects are involved, then computational efficiency of
the ^: implementation will often not be the key priority.

And... copying is one of the faster operations that computers support. Not
the fastest, but still pretty fast.

Anyways, ... if the situation is complicated enough that you might need
unanticipated copy operations, it's probably (not guaranteed, but still
likely) complicated enough that copying will be faster than recomputing.

Thanks,




--
This email has been checked for viruses by AVG.
https://www.avg.com

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to