Instead of implementing the half-assed C++ namespace model, just add
to the compiler a warning when it detects that there is a collision in
the current scope (two functions with the same parameters from
different units that can be called from the scope being inspected). I
believe function overload alread provides the necessary hooks, but i
cant do it because i have zero experience with FPC sources...

2012/8/21 Marcos Douglas <m...@delfire.net>:
> On Tue, Aug 21, 2012 at 3:08 PM, Marco van de Voort <mar...@stack.nl> wrote:
>> In our previous episode, Marcos Douglas said:
>>
>>> I proposed this sintaxe:
>>> uses my_long_unit_name as my;
>>> begin
>>>   my.proc();
>>> end
>>
>> This doesn't protect any better, since
>> the new unit might also define "my".
>
> True, but using this sintaxe I can use an alias to the third-party
> units so, I can use my own names to reference identifiers that I can
> not change.
> The collision still can exists? Yes, but in that case the programmer
> would be wrong, not third-party unit names or because the compiler not
> helped.
>
> The third-party could use a better and bigger name like "XyzNetSocket"
> but I could use just "net" (uses XyzNetSocket as net), for example.
>
> IMHO this is more sophisticated than pure namespace.
>
> Marcos Douglas
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to