Sign in Join

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

Mailing lists / fpc-devel / 2009-06

Ref documentation doesn't mention "deprecated" keyword

8 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

I searched the ref.pdf document, especially under the class definition section. It doesn't mention anywhere in that document that the Object Pascal language supports the "deprecated" keyword.

PS:
Can you mark a whole class as deprecated? As far as I know the deprecated keyword can only be used on methods in a class, not the class itself. The latter would be very handy.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Paul Ishenin
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
I searched the ref.pdf document, especially under the class definition section. It doesn't mention anywhere in that document that the Object Pascal language supports the "deprecated" keyword. PS: Can you mark a whole class as deprecated? As far as I know the deprecated keyword can only be used on methods in a class, not the class itself. The latter would be very handy.

I am wondering why not to try?

type
   TMyClass = class(TObject)
   end deprecated;
TMyClass.Create;

SomeUnit.pas(x,y) Warning: Symbol "TMyClass" is deprecated

As I know you can deprecate any symbol and even unit.

Best regards,
Paul Ishenin.

Reply by email

Graeme Geldenhuys
to Paul Ishenin

2009/6/1 Paul Ishenin :

Show quoted text 6 lines
I am wondering why not to try? type  TMyClass = class(TObject)  end deprecated;

I tried, but get a compiler error. :-( It would be very handy though. Especially in tiOPF (and probably FPC and LCL as well), we have old classes that have since been renamed or refactored that they are not needed anymore. I would like to encourage developers to use the newer classes instead.

As I know you can deprecate any symbol and even unit.

How do you mark a unit as deprecated?
In the user.pdf I have seen many references to units being deprecated (eg: graph, oldlinux, etc), but I have only seen that being mentioned in the documentation. There doesn't seem to be any compiler reference or deprecated keyword marking that unit as deprecated. Or I clearly missed something. ;-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Daniël Mantione
to Graeme Geldenhuys

Op Mon, 1 Jun 2009, schreef Graeme Geldenhuys:

Show quoted text 6 lines
How do you mark a unit as deprecated? In the user.pdf I have seen many references to units being deprecated (eg: graph, oldlinux, etc), but I have only seen that being mentioned in the documentation. There doesn't seem to be any compiler reference or deprecated keyword marking that unit as deprecated. Or I clearly missed something. ;-)

There is a distinction between legacy & deprecated. I.e. Graph remains a supported unit. It may not be the best idea for new code, but there is no recommendation against using it.

Daniël

Reply by email

Paul Ishenin
to Graeme Geldenhuys: 2009/6/1 Paul Ishenin : I tried, but get a compiler error. :-( It would be very handy…
Graeme Geldenhuys wrote 10 lines
> type > TMyClass = class(TObject) > end deprecated; I tried, but get a compiler error. :-( It would be very handy though. Especially in tiOPF (and probably FPC and LCL as well), we have old classes that have since been renamed or refactored that they are not needed anymore. I would like to encourage developers to use the newer classes instead.

Have you tried as I wrote?

Show quoted text 8 lines
> As I know you can deprecate any symbol and even unit. How do you mark a unit as deprecated? In the user.pdf I have seen many references to units being deprecated (eg: graph, oldlinux, etc), but I have only seen that being mentioned in the documentation. There doesn't seem to be any compiler reference or deprecated keyword marking that unit as deprecated. Or I clearly missed something. ;-)

Seems for unit this is not availble if fpc. Delphi allow use of deprecated and platform marks for units too.

Best regards,
Paul Ishenin.

Reply by email

Marco van de Voort
to Daniël Mantione: Op Mon, 1 Jun 2009, schreef Graeme Geldenhuys: There is a distinction between legacy &…

In our previous episode, Dani�l Mantione said:

Show quoted text 10 lines
> How do you mark a unit as deprecated? > In the user.pdf I have seen many references to units being deprecated > (eg: graph, oldlinux, etc), but I have only seen that being mentioned > in the documentation. There doesn't seem to be any compiler reference > or deprecated keyword marking that unit as deprecated. Or I clearly > missed something. ;-) There is a distinction between legacy & deprecated. I.e. Graph remains a supported unit. It may not be the best idea for new code, but there is no recommendation against using it.

It is also more a hint that something is going on than a final precisely described verdict.

Like while e.g. unit libc is deprecated (stronger, IMHO never was anything else), but I don't have plans to remove it as long as it is usable and maintainable. I just want to avoid that people grep the sources, find calls there and start using it.

Reply by email

Graeme Geldenhuys
to Paul Ishenin: Have you tried as I wrote? Seems for unit this is not availble if fpc. Delphi allow use of

2009/6/1 Paul Ishenin :

Have you tried as I wrote?

My mistake, I typed...

type
  TMyClass = class(TObject)
  end; deprecated;

instead of...

type
  TMyClass = class(TObject)
  end deprecated;

I used deprecated like you do for methods... after the last semi-colon.

Seems for unit this is not availble if fpc. Delphi allow use of deprecated and platform marks for units too.

That would be nice for FPC as well... ;-) The code I'm working on (tiOPF) is shared between Delphi and FPC compilers, so if deprecated is supported on both, that would be ideal (though not the end of the world if it's not).

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email