Skybuck Flying schrieb:

^ All of these examples are quite bad in the following way:

They become very static, which makes it pretty much impossible to change
their range at runtime.

That's by design.

These types are pretty much a left over from the days of turbo pascal, and
is a reason why people switched to C, where arrays where dynamic in
range/size.

C arrays are emulated by pointer operations, i.e. p[i] is equivalent to (p+i)*, with no chance left for range checks.

Delphi has added dynamic arrays, with range checks possible at runtime.


The succ/pred functions are also pretty useless and dangerous.

Depends on proper implementation (with wrap-around).

DoDi
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to