On 2015-04-03 12:35, Marco van de Voort wrote:
>> > That way we don't need $IFDEFs or special Unit Search Paths, just
>> > specify "FMX" or "VCL or "LCL" in the Project Unit Scope names list.
>> > 
>> > You then simply refer to those units in your uses clause by using:
> Not entirely, since you can afaik use the whole unit names qualified ?

I understand that, but in the context of the example, the tiOPF project
has different implementations of the same functionality for different
GUI toolkits. So in that case the developer would use the partial
namespace unit name (tiMediator or tiListMediator) in the uses clause,
and the compiler will figure out which fully quality unit you mean, by
looking at the Namespace Scope List.

In my other example with using very generic unit names (eg:
constants.pas), then you would opt to use the fully qualified unit name
in the uses clause to tell the compiler which unit you are referring too.

So those are two very different situations and uses of the namespace
feature. Like I said, I've never used namespaces personally, but I'm
sure more usage examples exist. I think it is quite a useful feature,
and should not only be considered "cosmetic unit names".

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to