Recent

Author Topic: Delphi compatibility  (Read 3652 times)

paule32

  • Sr. Member
  • ****
  • Posts: 280
Re: Delphi compatibility
« Reply #15 on: May 05, 2024, 01:54:20 pm »
That was an example as I see this feature in fpcobj, not in delphi mode.

WooBean

  • Sr. Member
  • ****
  • Posts: 279
Re: Delphi compatibility
« Reply #16 on: May 05, 2024, 02:37:55 pm »
Code: Pascal  [Select][+][-]
  1. {$mode delphi}{$macro on}
  2. { delphi compatibility aliases }
  3. {$if fpc_fullversion < 30301}
  4. ...
  5. // a lot more
  6. {$ifend}
  7. ...

I was surprised that we already have a compiler directive "{$ifend}".
It could be a nice feature in the future to allow "guessing" needed directive (parts) by programmers.
So, "{$ifend}" should be treated as "{$endif}". Now it is not allowed.
« Last Edit: May 05, 2024, 02:57:20 pm by WooBean »
Platforms: Win7/64, Linux Mint Ulyssa/64

Thaddy

  • Hero Member
  • *****
  • Posts: 16399
  • Censorship about opinions does not belong here.
Re: Delphi compatibility
« Reply #17 on: May 05, 2024, 03:21:20 pm »
It is a bit the other way around. {$ifend} is a legacy notation that closes {$if}. Nowadays you can use {$endif} for both {$ifdef} and {$if}.
I still prefer to close {$if} with {$ifend} and close {$ifdef} with {$endif}.
But is is not required anymore. Reason is simply Delphi compatibility.
But the old way makes more notational sense.
« Last Edit: May 05, 2024, 03:57:38 pm by Thaddy »
There is nothing wrong with being blunt. At a minimum it is also honest.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5815
  • Compiler Developer
Re: Delphi compatibility
« Reply #18 on: May 07, 2024, 09:45:27 pm »
That was an example as I see this feature in fpcobj, not in delphi mode.

It doesn't matter. Built-in operators are not overloadable in any mode. That is not going to change.

 

TinyPortal © 2005-2018