[fpc-pascal] Illogical automatic dereferencing

Florian Klaempfl florian at freepascal.org
Tue Oct 13 15:17:39 CEST 2009


Jürgen Hestermann schrieb:
> 
> 
>> Florian Klaempfl schrieb:
>>>> Great power comes with great responsibility.
>>> Yes. Then use C or assembler. You are "responsible" for everything and
>>> you cannot expect any help from the compiler.
>> So the consequence would be to forbid pointers/@-operator/type casts et.
>> al. 
> 
> No. Only the logic has be kept strict. Otherwise noone realy knows what
> to write when coding and starts guessing.

When messing with pointers you've to know what to write because pointers
allow unlimited access to internal data structures. Sorry, but I can't
help you if you guess wrong while playing with dangerous stuff (and the
original poster did so: using move is a dangerous operation) instead of
reading the manual.

> 
>> If you want pointers and all dirty stuff, use C or assembler.
> 
> Pointers are great in Pascal (if the syntax wasn't influenced by C) but
> a nightmare in C. It's just that it would be very easy to handle
> pointers in Pascal but then the syntax and logic has to stay strict.

They are strict. However, if one does not understand the logic, it looks
indeed like magic. If you don't understand the logic it does not mean
that it is an unstrict logic.

And before I continue to discuss I expect answers to my questions in my
other mail (e.g. how you propose to define and use pchar).



More information about the fpc-pascal mailing list