On Wed, 5 May 2010 13:44:40 +0200
José Mejuto <joshy...@gmail.com> wrote:

> The same applies to Pascal, my previous example is badly designed, but
> better than the first one. The problem here is try to use "move" as a
> Pascal way of do things. Move is low level function that should be
> used to optimize code when you known underalying structure, if you do
> not known this one you should copy/move element by element:
> 
> for j:=Low(ArraySource) to High(ArraySource) do
>   TargetArray[j]:=ArraySource[j];

Is this the way one should implement *really* dynamic arrays: in which one can 
remove or insert elements and still have index and count corrects?
Are there other methods than moving all elements of higher index up or down? If 
no, is the correct method analog to the above loop? (But inside a unique 
dynarray)?
Or would it be better to implement such semantics from static arrays directly?

Denis
________________________________

vit esse estrany ☣

spir.wikidot.com
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to