[Lazarus] Delphi editor clone

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri Nov 6 15:38:59 CET 2009


Vincent Snijders schrieb:

>>> All fine and good. But it doesn't help, unless you convince the fpc 
>>> developers.
>>
>> Right :-(
>>
> 
> Little chance, because they made this change on purpose:
> http://wiki.lazarus.freepascal.org/User_Changes_2.4.0#Treating_direct-mapped_properties_as_regular_fields 

Did you notice that the example does *not* provide a solution? For good 
reason, IMO, because the changed property handling results in an code 
bloat for no specific reason. When the compiler could determine in the 
past, where assignemts to e.g. fields of record properties are possible, 
and where they are not, it can continue to do so.

My preferred workaround for the changed Inc/Dec behaviour is a macro, 
that allows to preserve exactly the old behaviour, without bloating the 
code. I wonder where there remains anything good, when the compiler then 
will have to process a macro and to do CSE, where it has not been 
required in the past, and possibly will generate *more* code for exactly 
the same result :-(


>>> Eventually the new Version of FPC will be used, and eventually all 
>>> code has to be able to be compiled with it....

I'd wait at least for an official FPC release before changing the LCL 
code. Perhaps there will come a compatibility option, that allows to use 
the old behaviour even in new FPC versions.



>> I have several suggestions:
>>
>> - apply the new rules only in $mode Delphi
> 
> The reason for the change was better following the object pascal 
> language: the use of properties should not depend on the way they are 
> implemented. This is not a Delphi only choice.

Who defines the OPL? If compatibility with other than Delphi compilers 
is desired, according modes can be added.

The behavior/implementation of Inc/Dec is questionable, together with 
the stricter property abstraction. (see my above workaround)



>> I'll have to get a SVN version of fpc, before I can start fixing my 
>> code...
>> And if so, I only will replace Inc/Dec by my added Incr/Decr macros. 
>> You can do so yourself, already. Feel free to update my code 
>> accordingly :-)
>>
> 
> You need to update your compiler version anyway, if you want to start 
> implementing macros with parameters. ;-)

Oops :-(

DoDi





More information about the Lazarus mailing list