On 28 Apr 2010, at 08:05, Jürgen Hestermann wrote:

I am not sure whether this now cast in stone forever. Errors *can* be corrected sometimes. ;-)


The behaviour of dynamic arrays will not be changed. At best, one day we may add GPC-compatible array schema types (see http://www.gnu-pascal.de/gpc/Schema-Types.html , the part under "As a GNU Pascal extension, the above can also be written as"). These don't hide anything.

A simple solution would be to use the address the pointer is pointing to (address of first element) for fillchar/move too.

It would break code like this:

type
  tbytedynarr = array of byte;
var
  a: array of tbytedynarr;
begin
  setlength(a,10);
  { initialise all dynamic array elements of a}
  ...
  { now delete one of these elements }
  finalise(a[4]);
  { and compact the array }
  move(a[3],a[4],(length(a)-3)*sizeof(a[0]));
end.

With your change, move() would operate on the contents of a[3] tbytedynarr instead of on the contents of "a" itself.



Jonas_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to