[fpc-pascal] dynamic array contents and system.move

Florian Klaempfl florian at freepascal.org
Sun Apr 25 13:35:17 CEST 2010

Juha Manninen schrieb:
>> This is plainly wrong. When indexing a dyn. array, the compiler
>> generates the correct code to access the data, no more no less.
> It would be possible to allow this syntax :
>   move(data ...
> in addition to the current :
>   move(data[0] ...
> There is no fundamental reason why it wouldn't be possible. 

There is: there is no reason why move should be handled differently than
other procedures.

> The compiler would 
> generate the correct code as you mentioned.
> Every newbie is struggling with this syntax. I remember struggling with it 
> myself. It is not intuitive at all.

If you mess with move and have no clue about internals, then you get
burned. Period. Proper dyn. array code uses copy(...) instead of move.

More information about the fpc-pascal mailing list