[fpc-devel] Some compiler changes...

Daniël Mantione daniel.mantione at freepascal.org
Tue Jan 23 17:10:18 CET 2007



Op Tue, 23 Jan 2007, schreef Luiz Americo Pereira Camara:

> Ale? Katona wrote:
> > I agree. I'm starting to feel sick of all the compat crap you guys put
> > up with playing the bitch of delphi. The problem is that now delphi is
> > the bitch of .net so I think wisest would be to implement 100% compat up
> > to delphi 7 and be done with it. Then just document the fact and point
> > people to mode objfpc and our new stuff.
> > 
> 
> This makes me remenber of copying weird behaviors of Delphi. As an example see
> the code:
> 
> AList:=TStringList.Create;
> with AList do
> begin
> writeln('Set a string with space (aaaa;bb bb;cccc) to DelimitedText');
> DelimitedText:='aaaa;bb bb;cccc';
> writeln('Count: ',Count);
> writeln('Delimited text: ',DelimitedText);
> writeln('Strings: ');
> for i:= 0 to Count - 1 do
>  writeln('  ',Strings[i]);
>  Destroy;
> end; 
> 
> Output:
> Set a string with space (aaaa;bb bb;cccc) to DelimitedText
> Count: 4
> Delimited text: aaaa;bb;bb;cccc
> Strings:
> aaaa
> bb
> bb
> cccc
> 
> 
> The space is used as a hardcoded delimiter being necessary to enclose with ".
> This limits the use of DelimitedText as a generic approach since is necessary
> to preprocess the strings being added though DelimitedText.
> 
> The argument to keep such behavior is compatibility but there will be always
> differences when porting code and the programmer must be aware. What is
> necessary is to document the differences. So in resume i think that fpc must
> not follow strictly Delphi, and in some situations, where appropriated, fpc
> can/must do things different/better than Delphi.

Yes, but unless it is clearly a Delphi bug, it is better to keep the 
Delphi compatible procedure or class and write a new clean one. Wether 
something is a bug or intended behaviour usually becomes clear after 
reading the the documentation.

Daniël


More information about the fpc-devel mailing list