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

Martin fpc at mfriebe.de
Mon Jul 26 18:43:19 CEST 2010

On 26/07/2010 17:29, Marcos Douglas wrote:
>> Not exactly. Yours is a bit different:
>> uses
>>   Foo in 'whereever/the/lcl/dir/is' as FooLCL,
>>   Foo in 'whereever/the/rtl/dir/is' as FooRTL;
>> The idea of Martin's concept is to define "aliases" for the search paths as
>> well so that you can change them by configuration or command line. So you
>> wouldn't need to check whether your path to the e.g. the LCL is the same as
>> on Martin's computer or mine.
>> Whether we use "as" or "alias" and a string or an identifier for the unit
>> alias is not that an important topic.
> Okay, but Martin's gave us an example: uses Buttons in 'LCL'
> ...and if I have a buttons.pas too?
> Will be like that?
> uses
>     buttons in 'LCL', buttons {my buttons};
> The classes/functions/etc will be depends what unit was declared for last?

Needs to be defined.
What happens, now, if you have Buttons.pas in your project path?


1) no IN => use current dir / project
2) IN '.' => '.' is a path = the current dir.
In (without alias) works on the directory that is current for fpc => 
should be the project
3) IN 'PROJECT'  / IN '@'
Define a constant alias/symbol  for  the "current project
4) allow the user to specify a symbol for his project

- With solutions 2,3,4 => a definition is needed for 1 => what is 
default => should be same as currently
- 2: In '.'  => would also always work => same as currentl / current dir
- 3: IMHO not good
- 4: Can always be allowed -FuFOO:.  // note the dot as dir => current 
dir => should be project dir

More information about the fpc-devel mailing list