[fpc-pascal] Illogical automatic dereferencing
Jürgen Hestermann
juergen.hestermann at gmx.de
Mon Oct 12 10:47:49 CEST 2009
> And the criticism about introducing Cisms in FPC/Delphi is also old. In the
> past I would have joined you, but after a few non-trivial header conversions
> and library conversions that pretty much died out.
But why are you then using Pascal at all? I love this language because
of its strict logic (which make coding and debugging much easier) but
having all these illogical C-style things creeping in makes it less Pascal.
if you have
var p : pchar;
what do the following contructs mean?
p
p^
@p
p[2]
@p[2]
If it were pure Pascal I could immediately tell you but with this
C-style notation I am always doubting about the meaning. To put one on
top, the meaning is even context dependent (using it in an expression or
as a paramater of a function may give it have different meanings).
I am not sure why following the strict logic would generate more work.
Of course, automatic translation from C to Pascal is getting more
difficult, because you then face the drawbacks of C. If you transfer C's
flaws into Pascal there is no need for changes. But what are you
getting? You get C.
> In 1.0.x times headers were often "pascalized", but if you have answered
> several tens of bugreports where people converted a C example and pass a
> pointer to a formal parameter, you get tired of it. Likewise you also get
> tired when you need to update some header (or code like zlib,jpeg) and have
> to guess what the purpose and consequences of some pascallization are.
And the solution was to introduce the same C design flaws into Pascal so
there was no need to change code (other than replacing { by begin and }
by end)? Then what is the difference between Pascal and C anymore?
More information about the fpc-pascal
mailing list