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

Jürgen Hestermann juergen.hestermann at gmx.de
Sun Apr 25 17:38:48 CEST 2010


>> 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.

But currently move *does* handle dynamic arrays differently than other procedures. You can use an array as parameter for a function or procedure and it does not matter whether it's dynamic or not. So the identifier means the array in both cases. But this does *not* apply to move or fillchar! That's illogical.

> If you mess with move 

What do you mean with "mess". It's a standard function since decades. The only thing that was "messed up" was the syntax of dynamic arrays.

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

That's nonsense. The only thing that is wrong here is that the identifier for an dynamic array means different things dependend from the context. 



More information about the fpc-pascal mailing list