[fpc-pascal] Namespaces Support

Marco van de Voort marcov at stack.nl
Sun Oct 27 14:13:59 CET 2013


In our previous episode, Fabr?cio Srdic said:
> > used in Java and .NET as either languages don't have "units".
> > Adding "features" just because "enterpise-class dev platforms" have them
> > is more marketing move, than actual technical need.
> >
> 
> We can't nest units to form a hierarchical content. With namespaces, we
> can.

Yes. But that doesn't need renaming all existing units. It is that part that
I think that is excessive.

Embarcadero did it probably to keep their hands free for some long term VCL
phase-out (IOW that they wouldn't have to rename FM to avoid VCL names).

We don't have any major such problems, and thus renaming everything is a bit
draconical to me. At least till we really have a reason to do so.

> Furthermore, namespaces can be used to disambiguate identifiers with
> the same name, eliminating the need to prefix our identifiers.

That is the main reason why it is added to so many languages;

BUT, Unit based Pascal never had that problem, since units already have
their own namespace.

Namespaces are only for pseudo hierarchical disambiguation of unit names in
Pascal.  




More information about the fpc-pascal mailing list