[fpc-pascal] dynamic array contents and system.move
juergen.hestermann at gmx.de
Tue Apr 27 18:04:18 CEST 2010
> A file type is actually also a record and you cannot access the fields
> without an explict type cast.
At least a file identifier always means the same memory address (where the record data is stored). If needed (for some special purpose) I *can* typecast it because I know the address of the data (@myfile). But when using the identifier of a dynamic array then this identifier does not always mean the same address of the array but sometimes means the pointer to it. That makes it illogical.
> Logic is nice but sometimes it makes no sense especially since you're
> not supposed to access dyn. arrays by ^ becuase it usually breaks the
> automatic management of dyn. arrays.
That's something the user should decide. The language should not build up artificial obstacles to obfuscate what is happening in the background. If you only copy the data to somewhere else (which is *not* a dynamic array) then there is no need to bother about reference count etc.
More information about the fpc-pascal