[fpc-pascal] Re: How to avoid namespace name clashes after USES ?

Timothy Madden terminatorul at gmail.com
Tue Aug 21 13:50:51 CEST 2012


On 08/21/2012 02:17 PM, DaWorm wrote:
> Very tedious, but you could create a wrapper unit and/or class for each
> library, and expose a prefixed name instead of the original. 

Very ingeniuos, I believe this is as close to a solution as I can get
for now.

But there are still a few probles I can see:
   - there is no way to "prefix" symbols within a unit, that I know of.
     Symbols may only be prefixed by the unit name directly. Is there a
     sort of a "namespace" in Pascal ?
   - if I make a wrapper unit around the third-party one, there is
     alredy little need for a prefix, since I can expose only the
     symbols I know of and that I use.
   - I find it even more tedious to do the same thing with the System
     unit or the standard Pascal units.

And then, if wrapper unit publicly uses the third-party unit, doesn't
that mean that all symbols in the thrid-party unit are now automatically
exposed and public in the wrapper unit ?

If so, is there a way to expose and make public the types, classes,
variables and functions from a private (implementation) unit ?

Thank you,
Timothy Madden





More information about the fpc-pascal mailing list