On Fri, 25 Oct 2013, Marco van de Voort wrote:

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.

There is a need. Without it, you will severely cripple the use of default 
namespaces.

If someone * defines a namespace 'mycompany', * uses that namespace as the default namespace
* has a 'classes' unit (or anything else that name-clashes with our units) in 
that namespace
  he/she will never be able to use our classes unit again.

This is not so far-fetched as it may seem, becaus this kind of thing is exactly why namespaces were invented, so you CAN choose your names to match FPC unit names. So people that use namespaces
are likely to do so.

So you have something like

{$NAMESPACE MyCompany}
uses Classes; // Adds MyCompany.Classes

So, how to add our own classes unit to the uses clause ?

You can probably work your way around it, but if the FPC distributed units have namespaces, there is no problem.

I'm not necessarily advocating this, but it seems to me that if you enable use of namespaces, putting all FPC units in appropriate namespaces is the logical and consequent thing to do.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to