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

DaWorm daworm at gmail.com
Tue Aug 21 13:17:48 CEST 2012


Very tedious, but you could create a wrapper unit and/or class for each
library, and expose a prefixed name instead of the original.

Jeff,
On Aug 21, 2012 3:31 AM, "Jonas Maebe" <jonas.maebe at elis.ugent.be> wrote:

>
> On 20 Aug 2012, at 18:15, Timothy Madden wrote:
>
> > This story is inspired from a real case when *lots* of user code
> > suddenly stopped compiling after JDK 1.2 was released, with a new List
> > class, which users had to import from a different package until JDK 1.1.
> > In this case is wasn't even a third-party library that triggered
> > conflicts in existing code, it was the system run-time library. Since
> > that story most Java programmers prefer to import and enumerate each and
> > every class they use explicitly, instead of importing the package that
> > provides the classes
>
> Importing a single class in Java still requires you to specify the full
> package name, so how would that help preventing compilation failures in
> case a class is moved from one package to another?
>
> > (I believe there is no equivalent feature in Pascal
> > that imports only one symbol from a unit).
>
> Indeed.
>
> > Is there any form of proposal or some alternative to the USES clause,
> > that will keep all the imported symbol names qualified by some namespace
> > name or by some prefix I choose ?
>
> Not that I know of.
>
>
> Jonas_______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120821/0f4517d4/attachment.html>


More information about the fpc-pascal mailing list