alternative aliases [Re: [fpc-devel] Re: [fpc-pascal] Re: Ideas for namespace implementation]

Alexander Klenin klenin at gmail.com
Tue Jul 27 11:32:00 CEST 2010


On Tue, Jul 27, 2010 at 02:54, Martin <fpc at mfriebe.de> wrote:
> On 26/07/2010 16:49, Martin wrote:
>>
>> -Fu=/path/to/lcl  // already existent, unit search path
>> -Fa-LCL:/path/to/lcl  // define the LCL alias
>
> should have been an = sign
> -Fa=LCL:/path/to/lcl  // define the LCL alias
>
> alias ends at the ":" or whatecer separator is defined.
>
> ---------
> Thinking about it, there is no need for an extra -Fa (define alias)
>
> -Fu can just be extended
>

Also a good idea.
Two points:
1) It is very important to allow relative search paths,
with well-defined semantics.
Otherwise, projects would quickly become non-portable between machines.

2) Another alternative to consider is path-based namespaces,
i.e. "uses Path.To.Lib1.Utils" would
use unit "{project root}/path/to/lib1/utils.pas"
The advantage is no need for extra compiler configuration.
I think that ability to use plain
"fpc myproject.pas" to build the whole project is an important
advantage which would be lost with your alias proposal.


-- 
Alexander S. Klenin



More information about the fpc-devel mailing list