Sign in Join

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

Mailing lists / fpc-devel / 2010-05

Missing from documentation

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi Michael,

* Shouldn't Specifiers be mentioned in the Language Reference doc chapter 1? Similar to modifiers - they are not reserved words, but also not encouraged to use as identifiers.

* Properties, section 4.6, of the Language Reference documentation doesn't mention the 'implements' specifier in the diagram (page 54). Its got read, write and default, but not implements.

Regards,
- Graeme -

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

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys

Graeme Geldenhuys het geskryf:

* Properties, section 4.6, of the Language Reference documentation doesn't mention the 'implements' specifier in the diagram (page 54). Its got read, write and default, but not implements.

Sorry, I see this chapter is related to global variables, and 'implements' is actually covered in Class > Properties (page 75).

BTW: I actually learnt something new now. I never new you could have a property outside a class. I can't say that in the many years I have been programming with object pascal that I have ever seen properties used as a global variable. Umm?

-------[ How weird is this legal code?? ]---------------
unit unit1;
  {$mode objfpc}
interface
  function GetMyInt : Integer;
  procedure SetMyInt(Value : Integer);
property MyProp: Integer Read GetMyInt Write SetMyInt;
implementation

--------------------------

Regards,
- Graeme -

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

Reply by email

Jonas Maebe
to Graeme Geldenhuys
Graeme Geldenhuys wrote 6 lines
BTW: I actually learnt something new now. I never new you could have a property outside a class. I can't say that in the many years I have been programming with object pascal that I have ever seen properties used as a global variable. Umm?

It's an FPC-specific extension. It's mainly used to implement the "port" construct from Turbo Pascal in the ports unit for Dos and Linux.

Jonas

Reply by email

Graeme Geldenhuys
to Jonas Maebe

Jonas Maebe het geskryf:

It's an FPC-specific extension. It's mainly used to implement the "port" construct from Turbo Pascal in the ports unit for Dos and Linux.

And you answered by next question before I could even ask it. :) I was looking for syntax help on that in the Kylix 3 help and couldn't find anything - now I know why.

PS:
I looked at the 'ports' unit, and it doesn't use that syntax either. Only 3 standard classes are defined in the interface section. Either way, I can honestly say I don't see myself ever using that syntax. :) Thanks for the info though.

Regards,
- Graeme -

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

Reply by email

Marco van de Voort
to Jonas Maebe: It's an FPC-specific extension. It's mainly used to implement the "port" construct from…

In our previous episode, Jonas Maebe said:

Show quoted text 9 lines
> BTW: I actually learnt something new now. I never new you could have a > property outside a class. I can't say that in the many years I have > been > programming with object pascal that I have ever seen properties used > as a > global variable. Umm? It's an FPC-specific extension. It's mainly used to implement the "port" construct from Turbo Pascal in the ports unit for Dos and Linux.

Baseunix.Errno is maybe a more used example:

  function fpgeterrno:longint; external name 'FPC_SYS_GETERRNO';
  procedure fpseterrno(err:longint); external name 'FPC_SYS_SETERRNO';
  property errno : cint read fpgeterrno write fpseterrno;

Reply by email