[Lazarus] *** GMX Spamverdacht *** Re: FW: Re: more file operation problems
Bart
bartjunk64 at gmail.com
Sat Dec 17 16:53:57 CET 2011
On 12/17/11, Sven Barth <pascaldragon at googlemail.com> wrote:
> I don't know whether it's Delphi compatible, but this error was already
> there if you've used AnsiString, so it is a logical extension that this
> error also appears if String is an alias to AnsiString.
>
> And yes, the compiler won't let you write such a record (or let you even
> define a "file of" type of this record).
So, even if I am suicidal, the compiler will prevent me from shooting
myself in the foot?
(Whereas C will shoot me in the foor even if I don't want to)
Although I like the fact that fpc prevents this (most likely) error in
my coding, I still think the code itself is valid Pascal. It only does
not do what I expect it to do.
So, I think a warning should suffice.
{$Mode Reductio_Ad_Absurdum}
If fpc forbids it, it should also forbid this:
var
P: ^Integer;
begin
p := nil;
p^:= 1;
end.
This code is insane, but it is perfectly legal Pascal.
{$Mode Normal}
Feel free to differ and decide what you think is best.
Most of the time when I disagree with some fpc devel, I (sometimes
much) later come to the conclusion that I was "wrong" anyway.
Bart
More information about the Lazarus
mailing list