Zitat von Florian Klaempfl <flor...@freepascal.org>:
Jürgen Hestermann schrieb:
Yes, but you cannot avoid it, if you work with dynamic arrays. You are
not even told that it's a pointer. That's just the problem.
Same for classes and strings. Classes are pointers and I'm happy that
I can write A.B instead of A^.B.
About pointer arithmetic:
IMO memory is an array. So for me it is quite natural that P^ and P[0]
are the same. I think this is a great feature of FPC, which I don't
want to miss. It's simple, unambiguous and readable - like pascal.
The only disturbing is the automatic dereferencing of pointer to
record/object in Delphi mode, where you can use PtrRect^.Left and
PtrRect.Left.
But that only works in delphi mode, which I avoid.
The problem is that one is playing with stuff he doesn't understand.
Explict use of pointers is always dangerous and one should really know
what he does especially on object pascal dyn. arrays which are much more
than a simply pointer to the data else one wrecks anyways havoc.
Great power comes with great responsibility.
Mattias
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal