[fpc-pascal] Dynamic arrays, yet another pitfall

Martin Frb lazarus at mfriebe.de
Mon Feb 17 20:26:40 CET 2014


On 17/02/2014 18:19, Jürgen Hestermann wrote:
>
> Am 2014-02-17 18:49, schrieb Martin Frb:
>> Then why does this discussion continue, now that it is documented?
>> Does it matter what other people consider a write and what not? 
>> (Unless that part made it into the docs, but there was no mention it 
>> did)?
>
> Of course it would not matter if it wasn't part of the documentation.
> But here http://www.freepascal.org/docs-html/ref/refsu18.html it still 
> says:
> "there is no copy-on-write".
> This sentence is wrong IMO.
No this is right.

As I said in my other mail:

> In the same way I can write functions for an object that performs a 
> (modifying) operation on the object, and copies the object before.
> Yet if I  wrote such code, no one would say, that the object I use, 
> has COW. 

Just because there is a function, that includes copying (when modifying 
the array), does not mean there is copy on write.

Otherwise all referenced data, would always be copy on write, because 
for any referenced data, such a function can be written.




More information about the fpc-pascal mailing list