Re: [fpc-devel] Ref documentation doesn't mention deprecated keyword

2009-06-01 Thread Paul Ishenin

Graeme Geldenhuys wrote:

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.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Ref documentation doesn't mention deprecated keyword

2009-06-01 Thread Graeme Geldenhuys
2009/6/1 Paul Ishenin i...@kmiac.ru:

 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/
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Ref documentation doesn't mention deprecated keyword

2009-06-01 Thread Daniël Mantione



Op Mon, 1 Jun 2009, schreef Graeme Geldenhuys:


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___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Ref documentation doesn't mention deprecated keyword

2009-06-01 Thread Paul Ishenin

Graeme Geldenhuys wrote:

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?


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.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Ref documentation doesn't mention deprecated keyword

2009-06-01 Thread Marco van de Voort
In our previous episode, Dani?l Mantione said:
  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.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Ref documentation doesn't mention deprecated keyword

2009-06-01 Thread Marco van de Voort
In our previous episode, Paul Ishenin said:
 As I know you can deprecate any symbol and even unit.

http://bugs.freepascal.org/view.php?id=13373
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Ref documentation doesn't mention deprecated keyword

2009-06-01 Thread Graeme Geldenhuys
2009/6/1 Paul Ishenin i...@kmiac.ru:

 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/
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel