[fpc-devel] Some compiler changes...

Luiz Americo Pereira Camara pascalive at bol.com.br
Tue Jan 23 16:28:50 CET 2007


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.

Luiz



More information about the fpc-devel mailing list