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

Nikolai Zhubr n-a-zhubr at yandex.ru
Sun Jul 11 23:46:31 CEST 2010


11.07.2010 17:47, Hans-Peter Diettrich:
> I know that the "in <filespec>" is part of the Delphi syntax, but what
> is it really good for?

For specifying path.
This way you are able to prevent any ambiguity in which file will 
actually be selected. Not sure how exactly this is implemented in FPC, 
but in Delphi, once you added "in ..." for all files of your interest 
(with correct path), you can forget about search paths altogether. 
(Sometimes, though not always, having search paths is less convenient, 
especially if there are many and if several projects share some random 
fractions of common files)

> AFAIK it's not allowed to "rename" units this way, and since (currently)
> only absolute filenames are implemented, I really wonder why FPC allows
> to use it everywhere?

Relative paths are supported (I use them on a regular basis).

Nikolai

> IMO the filespec should allow for relative pathes, and also the use of
> FPC macros should be possible (e.g. FPCSourceDir).
>
> When there exists interest in such an extended functionality, but nobody
> has the time to implement it, I'll try to implement it myself.
>
> DoDi
>
> _______________________________________________
> fpc-devel maillist - fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>




More information about the fpc-devel mailing list