[Lazarus] Identifier not found, but code completion works....

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Feb 21 09:05:03 CET 2011


On Mon, 21 Feb 2011 08:36:15 +0100
Bo Berglund <bo.berglund at gmail.com> wrote:

> On Mon, 21 Feb 2011 08:39:05 +0200, Graeme Geldenhuys
> <graemeg.lists at gmail.com> wrote:
> 
> >Op 2011-02-19 16:11, Bo Berglund het geskryf:
> >> 
> >> Is this bad practice with FPC/Lazarus?
> >
> >I don't think so. At least in my FPC-base programs I have always
> >preferred putting things first in the implementation uses clause before
> >the interface uses clause. As the old design statement goes.... On make
> >things public when really needed.
> >
> >Contrary to Mattias statement - this reduces circular unit references in
> >my case/applications. I could never understand how Mattias thinks otherwise.
> >
> >
> 
> In my past Delphi experience I was hit by circular references when
> placing my own units in the interface uses so I moved them to the
> implementation uses.
> Ever since then I have refrained from putting anything into Interface
> uses that is not explicitly needed by stuff in the interface.
> Has worked fine in all versions of Delphi that I have used (all from
> D1-D7 and then BDS2006 too).

That's what I mean.
Using the interface uses section, the compiler does not allow circular
dependencies. Moving it into the implementation section keeps the
circle between the units. I don't know if Delphi has no problems with
it, but FPC has some problems. They became smaller from year to year,
which is why the Lazarus code already uses them at a few places.
The problem does not appear immediately. This time
it appeared several months after adding a circle.
Breaking the circle also created a cleaner design. 
IMO cleaner design is pov, just as "readability", which is a
signal word for some developers and for some trolls as well.


Mattias




More information about the Lazarus mailing list