[Lazarus] OT: Namespaces?

Mattias Gärtner nc-gaertnma at netcologne.de
Tue Apr 7 11:36:43 CEST 2009


Zitat von Hans-Peter Diettrich <DrDiettrich1 at aol.com>:

> Mattias Gärtner schrieb:
>
> >>> why aliases units names are required?
> >> E.g. when you have multiple third-party units of the same name.
> >
> > Isn't that already supported by the 'in' modifier? For example:
> >
> > uses unit1, unit1B in '../test/unit1';
>
> Heureka :-)
>
> While Delphi 7 requires that the unit name matches the file name, even
> when using IN, and AFAIR allows for IN only in the project file (*.DPR),
> FPC imposes no such restrictions.
>
> Now we can go on-topic: While FPC already supports true unit alias,

FPC supports unit alias in a unit, but it does not support two different ppu
with the same name. At least 2.2.3 does not.
You will get linker errors, because identifiers of the second unit1 have still
the same prefix.
It is probably a bug, that FPC does not check and gives an error in this case.


> Lazarus (code completion...) cannot handle unit1B in your example :-(


Mattias




More information about the Lazarus mailing list