[fpc-devel] Purpose of "uses ... in"?

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jul 16 23:20:10 CEST 2010


On Thu, 15 Jul 2010 09:26:24 -0300
Marcos Douglas <md at delfire.net> wrote:

> On Wed, Jul 14, 2010 at 6:35 PM, Stefan Kisdaroczi <kisda at hispeed.ch> wrote:
> > I'm still using it. Or make a symlink:
> > ln -s rar/zip.pas rar.pas
> >
> > In combination with {$L xzy.o} and 'external name ...' you can do
> > wonderful things. Don't do this at home! (maybe at work :-)
> 
> Okay... this is very sophisticated. I have not used it (yet) but this
> is not so simple.
> I still thinking my sugestion (in other mail, and copied below) is a good way:
> 
> uses
>  zip IN '/units/my/zip.pas' AS myzip;
>  zip IN '/units/lib/zip/zip.pas' AS ziplib;

What is the 'zip in' good for?

 
> 2 units, same name, different paths and different "aliases" to use in project.

It means the compiler must rename all internal names of at least one of
the units and must adapt all .o files that use that unit. 
What should the compiler do, if it finds a unit that "uses zip;"? Which
one should it use?

 
> On Wed, Jul 14, 2010 at 7:06 PM, José Mejuto <joshyfun at gmail.com> wrote:
> > I can vaguely remember a case like this in Delphi several years ago,
> > but I think the problem was a precompiled .dcu which I can not rename.
> > Is this possible ?
> 
> ...but my sugestion do no serves for compiled files... or serves?


Mattias



More information about the fpc-devel mailing list