RES: [fpc-pascal] dot within unit file name

Daniël Mantione daniel.mantione at freepascal.org
Fri Jan 18 16:14:25 CET 2008



Op Fri, 18 Jan 2008, schreef Michael Van Canneyt:

>
>
> On Fri, 18 Jan 2008, Daniël Mantione wrote:
>
>>
>>
>> Op Fri, 18 Jan 2008, schreef Michael Van Canneyt:
>>
>>> To the user, it may appear as a bunch of dots. To the compiler, it doesn't
>>> know how to map the a.b.c.d:
>>
>> Well, with normal Pascal rules, you cannot declare a variable with the same
>> name as a unit you use, because a unit is also an identifier. Most logical
>> would be to reject the declaration of variable A in this case due to a
>> duplicate identifier.
>
> No, because the unit identifier is a.b.c, not a.

> It has to be, otherwise units windows.messages and windows.records would
> both have identifier windows, leading to an error.

You are right. In other words, .NET namespaces cannot be unified with 
normal scoping rules, meaning you would need a new set of scoping rules 
and mark the old ones legacy. Not acceptable. I have made my conclusion: 
No .NET namespaces and no dots in names.

Daniël


More information about the fpc-pascal mailing list