[fpc-pascal] Re: Ideas for namespace implementation
Marcos Douglas
md at delfire.net
Mon Jul 26 16:36:34 CEST 2010
On Mon, Jul 26, 2010 at 11:20 AM, Sven Barth
<pascaldragon at googlemail.com> wrote:
>
> What about that the compiler enforces that you use the fully qualified name
> if you used it in the uses?
Not only if you used it in the uses clause, but if you COMPILED with
namespace sintaxe (eg. by Graeme unit strutils namespace my), IMHO...
But we would have a problem stated by Michael:
On Mon, Jul 26, 2010 at 6:34 AM, Michael Van Canneyt
<michael at freepascal.org> wrote:
> Well, I fail to see what is more logical in my.constants than in
> myconstants.
> The unit is still called my.constants, not constants. So you'll end up
> typing my.constants everywhere anyway. The gain of this over myconstants is
> highly debatable.
So... maybe create a new directive like as {$NAMESPACE ON}
eg.
{$NAMESPACE ON}
unit strutils namespace my;
With {$NAMESPACE ON} all units will have namespaces, unless FPC's units.
MD
More information about the fpc-pascal
mailing list