Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-08

Re: (no subject)

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Peter Vreman
Show quoted text 26 lines
Quoting shifted soul : > 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.

Show quoted text 41 lines
> 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.

Full_Name
to Peter Vreman

Quoting Peter Vreman :

Show quoted text 5 lines
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.

I already said that I haven't looked at any non official/development releases. After all, they aren't meant to be used for anything purpousful, with words such as 'compiles, but doesn't do X, Y or Z'.

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 ':='.

Actually, the assignment operator ':=' makes little sense, the '=' is the correct operator. You cannot *change* the value of an enum type at runtime, and therefore it's a constant; we use '=' to assign values to constants, even assignable typed const's.

The way FPC overloads is ugly.

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

You have too many modes. A TP/BP, a Delphi is all you really need.

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.

Kool.. this is no use on a windows system though is it?

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

He called the destructor 'A2'.. it never gets called.. not even if you call the 'Free' method. *THAT* is the problem. Not in Delphi5 *or* in FPC1.0.2. There is going to be a memory leak in every app he ever writes if he doesn't start using the correct conventions. That is what I was telling him.

Matt

-----BEGIN GEEK CODE BLOCK----- Version: 3.12 GCS d? s+++:+ a- C++ UL+ P L++ E---- W- N+ o+ K- w O- M V PS PE-- Y PGP- t- 5-- X- R- tv+ b+ DI++ D+ G e++ h--- r+++ y+++ ------END GEEK CODE BLOCK------
Jonas Maebe
to Full_Name
Full_Name wrote 5 lines
> So i don't see what you mean with not trying to follow delphi > standards, > we've the delphi mode for compiling delphi programs. You have too many modes. A TP/BP, a Delphi is all you really need.

I think you mean that it is all *you* need. There are plenty of people who use other modes (most notably, we do so ourselves in most of the RTL). And while you may think the way FPC handles certain things is ugly, I feel the same about other things in Delphi, TP, e.g. procvars. Imho

var
   p: procedure;
  p1: pointer;
begin
  p1 := @@p;
end.

is completely ridiculous code... And it makes a statement such as "p1 := @p" impossible to understand, unless you know whether p is a "normal" variable or a procvar.

Jonas