[fpc-pascal] Looking for JavaScript component on FPC

Marco van de Voort marcov at stack.nl
Fri Apr 3 15:03:17 CEST 2015


In our previous episode, Graeme Geldenhuys said:
> 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.

True, but keep in mind if more component vendors have that attitude,
the number of scopes that must be in the list rises again, with the risk
of conflicts.

It is mainly to fix these issues in Embarcadero's OWN system.
 
> 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.

True. Like Lazarus and FV both have "dialogs".

> So those are two very different situations and uses of the namespace
> feature.

No. Since if you prefix with namespace you usually do that because you have
some scope case (like importing legacy projects). Otherwise you would
immediately call it lcldialogs instead of lcl.dialogs.

> Like I said, I've never used namespaces personally, but I'm sure more
> usage examples exist.

Anything that exists can be abused :_)

>  I think it is quite a useful feature, and should
> not only be considered "cosmetic unit names".

The transition is annoying. If we would rename e.g. LCL now, it would not
work with 2.6.4 anymore, and working around that (by leaving all code the
same and adding a scope name) would require careful upgrading of old
projects.

In Delphi mixing XE2 and later and before is annoying for that reason too.
(and I know, since we have XE and XE3 in our company ;-)



More information about the fpc-pascal mailing list