[fpc-pascal](no subject)

Peter Vreman peter at freepascal.org
Mon Aug 20 17:46:45 CEST 2001


> Quoting shifted soul <snsii at yahoo.fr>:
> 
> > Matt
> > I know that if standards are not used then the
> > programmer will go into a black hole. But if FPC is a 
> > 'new' compiler why not extend the standards.
> 
> FPC is not a 'new' compiler. It has been in development for a number of years, 
> I certainly first heard about it over 3 years ago. There have been two releases 
> of Delphi, and Kylix since that point. New, no.
> 
> > If we don't go ahead, we can't grow. I explain :
> > standards are made step by step, and any new thing
> > added to a standard is viewed badly by the others. 
> 
> My point was that the FPC core team (the guys that, let's face it, make the 
> compiler work for all of us 'users') keep complaining about a lack of time to 
> improve the compiler. But in all honesty, with a focused objective they will 
> waste less time adding 'standards' that no one actually wants. Let me qualify 
> that a little; no one has yet created a compiler that meets the standard that 
> everyone is looking towards, and there is no call for one. By creating one, 
> surely all they are doing is wasting time (whether this be a lot or a little) 
> on a specification that essentially is worthless. The spec is nearly 10 years 
> old - if no one has created a commercial compiler yet that uses the standard, 
> why do we need one? Using a standard, just because it's there isn't the correct 
> way to work, especially in time constrained projects.

We support already a lot of delphi specific things in the 1.1 branch, default parameters,
interfaces, widestrings (compiles but no codepage conversion yet), hint directives,
varargs directive. Even some of the more ugly hacks borland added in Kylix that FPC
already had for a long time like assigning values to enumerated values. They use the '='
to assign the value instead of the pascal style ':='.

So i don't see what you mean with not trying to follow delphi standards, we've the delphi
mode for compiling delphi programs.

And if you didn't read it yet, the 1.1 compiler is able to compile Libc.pas and  Qt.pas of
FreeClx with only a very small patch of adding two type definitions to Libc.pas instead of
System.pas.


> 
> > I give an example : I am a student, and when I said for my profs that I
> > can use object into pascal (with BP), he formally said that it is impossible 
> > and if a compiler do it (compiling a pascal source code with objects) this is
> > a wrong one (does not meet the pascal standrds!).
> 
> He's right. The Pascal standard had no OO. The *Object* Pascal (either the old 
> style TP/BP or Delphi standard) does. Object Pascal is to Pascal, as C++ is to 
> C. 'Object Pascal' is not the same as 'Standard Pascal', it's a super set of it.
> 
> > Then if they (the compiler's developpers) worked with your says (and 
> > the says of my profs), now we (me and you) will use the hex coding
> > only ! You know now what is the meaning of 'going ahead'?
> > :-)
> 
> I said that the Delphi standard was the one to aim for, not that OO was bad. 
> You obviously mis-understood what I was saying. 
> 
> > NB : The original message I send was not about standards, but about a 
> > technical issue in FPC : Why does it work?
> 
> It doesn't work. You must call the CONSTRUCTOR' to CREATE an instance of your 
> class. I already mentioned this in my post. Try the following (tested with FPC 
> v1.02 Win32):
> 
> Program ...;
> 
> {your code unaltered}
> 
> BEGIN
>  b := a.a1; //YOU MUST CALL THE CONSTRUCTOR
>  try
>    b.x := 10;
>    write(b.x);
>  finally
>    b.free;    //YOU MUST *FREE* YOUR INSTANCE
>  end;
> END.
> 
> However!!!! YOu *must* call your destructor 'Destroy' and override it. This is 
> true even in the standard that OBJFPC uses!!!!!

What is wrong with it?  Free calls the destructor Destroy. In delphi the same is true.







More information about the fpc-pascal mailing list