[fpc-pascal] Namespaces Support

Sven Barth pascaldragon at googlemail.com
Fri Oct 25 10:11:55 CEST 2013


Am 25.10.2013 09:24, schrieb Marco van de Voort:
> In our previous episode, Fabr?cio Srdic said:
>> e.g types -> system.types; winsock -> windows.winsock; winmouse ->
>> windows.winmouse
> Delphi uses winapi, not windows.
>
> And I see no need. There is so much code in use that assumes the standard
> names, and I don't see a need to force existing codebase users to rename
> everything just to free up a few unit names for packages that are
> essentially free to chose their own.
This is where support for default namespaces from Delphi XE2 comes in. 
After all XE2 uses that as well to keep old Delphi VCL applications 
working despite having changed all units to namespaced ones. Whether we 
define our default namespaces in the fpc.cfg or we put up a big note 
that says that one now needs to add option -FN... (assuming for a second 
that N is not yet used ^^) is up for debate though... (Lazarus could add 
this option automatically if it detects a compiler where the RTL uses 
dotted names, but the project's units contain e.g. "SysUtils")
Of course providing the possibility to change this per unit-global 
directive (as indicated my Michael's mail) might come in handy as well...

Regards,
Sven



More information about the fpc-pascal mailing list