[fpc-pascal] Move with pointers to memory

Rainer Stratmann rainerstratmann at t-online.de
Wed Nov 13 10:58:54 CET 2013


 On Wednesday 13 November 2013 10:52:23 you wrote:
> 2013/11/13 Rainer Stratmann <rainerstratmann at t-online.de>
> > Is there a description of the behaviour of const and var in this case?
> > Why is it not both const or both var?
> 
> "source" is where the data "comes from", so the procedure won't modify it
> (if there is no memory overlap between source and dest), so it is declared
> as "const"
> "dest" is where the data is copied to, so the procedure will necessarily
> modify it (if "count" is <> 0), and the procedure should modify so it is
> declared as "var". Actually, IMO it could be declared as "out", this would
> avoid a meaningless warning. 

But why does it work without specifying the vars more exactly like in other 
cases?



More information about the fpc-pascal mailing list