[Lazarus] FPDoc Editor fails on namespace dotted unit names?

Marco van de Voort marcov at stack.nl
Mon Apr 15 15:56:47 CEST 2013


On Mon, Apr 15, 2013 at 12:07:19PM +0100, Graeme Geldenhuys wrote:
> Someone recently explained Delphi's namespace usage to me, and gave me a
> valid example of this.
> 
> tiOPF has unit names with the same name, but used by different GUI
> toolkits. eg: tiMediators.pas is used by VCL, LCL and fpGUI. Each
> toolkit support has there own tiMediator.pas unit. You need to change
> unit search paths, so the compiler knows which unit to use.

> Anyway, recently somebody added FireMonkey support for the tiOPF
> mediators (Model-GUI-Mediator design pattern), but found an issue with
> threading. The tiOPF has a tiThread.pas unit, but FireMonkey's threading
> works differently.
> 
> So instead of littering the tiThread.pas code with IFDEF's, the
> developor simply duplicated the units (yeah, not too great), but then
> added the "FMX" namespace to that unit. eg:

Trouble is that it has the same problem as the define/ifdef. If you compile
in parts and forget to pass the -d (or -NS) to one stage, you get funky
errors.

True, one ifdef less in source (since unitname automatically adjusts), but
for that it is an very specialized feature, and there probably will be
consequences for unit searching also. (similar to the filename case stuff on
*nix)





More information about the Lazarus mailing list