Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2016-01

Dotted namespace

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dmitry Boyarintsev
Maciej Izak wrote 16 lines
2016-01-27 14:44 GMT+01:00 Michael Van Canneyt : > On Wed, 27 Jan 2016, Juha Manninen wrote: > > Hey guys ... >> >> Now this Generics.Collections is completely hijacked by a namespace >> discussion. Does it mean the original issue is again buried and >> forgotten for another year or two? >> > > No. Sven is on it. Anyway new thread for "Dotted namespace" is good idea :P

"Dotted namespace" how's that?
shouldn't be rather be "Dotted unit names" and "namespaces"? Since "dotted name" actually specify "namespace".
And a name of a space (scope), shouldn't have any dots since dot is a separator.

Because "dotted unit names" (without actual namespaces) might break compatibility with delphi's namespaces.

See:
http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/usingnamespaces_xml.html

For example: section "Multi-unit Namespaces"
unit MyCompany.ProjectX.ProgramY.Unit1
unit MyCompany.ProjectX.ProgramY.Unit2

"In this example, the namespace MyCompany.ProjectX.ProgramY logically contains all of the *interface* symbols from unit1.pas and unit2.pas.

Symbol names in a namespace must be unique, across all units in the namespace. In the example above, it is an error for Unit1 and Unit2 to both define a global interface symbol named mySymbol. " thanks,
Dmitry

Reply by email

Sven Barth
to Dmitry Boyarintsev

Am 27.01.2016 16:31 schrieb "Dmitry Boyarintsev" <

Show quoted text 25 lines
: On Wed, Jan 27, 2016 at 8:46 AM, Maciej Izak wrote: > > 2016-01-27 14:44 GMT+01:00 Michael Van Canneyt : >> >> On Wed, 27 Jan 2016, Juha Manninen wrote: >> >>> Hey guys ... >>> >>> Now this Generics.Collections is completely hijacked by a namespace >>> discussion. Does it mean the original issue is again buried and >>> forgotten for another year or two? >> >> >> No. Sven is on it. > > > Anyway new thread for "Dotted namespace" is good idea :P "Dotted namespace" how's that? shouldn't be rather be "Dotted unit names" and "namespaces"? Since "dotted name" actually specify "namespace". And a name of a space (scope), shouldn't have any dots since dot is a

separator.

Because "dotted unit names" (without actual namespaces) might break

compatibility with delphi's namespaces.

See:

http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/usingnamespaces_xml.html

Show quoted text 6 lines
For example: section "Multi-unit Namespaces" unit MyCompany.ProjectX.ProgramY.Unit1 unit MyCompany.ProjectX.ProgramY.Unit2 "In this example, the namespace MyCompany.ProjectX.ProgramY logically

contains all of the interface symbols from unit1.pas and unit2.pas.

Symbol names in a namespace must be unique, across all units in the

namespace. In the example above, it is an error for Unit1 and Unit2 to both define a global interface symbol named mySymbol. "

We're talking about one and the same feature. FPC's dotted unit names are implemented based on Delphi's namespace feature, but since they aren't namespaces in the strict sense we prefer to use the more accurate name of "dotted unit names".

Regards,
Sven

Reply by email

Marco van de Voort
to Sven Barth

In our previous episode, Sven Barth said:

Show quoted text 18 lines
> See: http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/usingnamespaces_xml.html > > For example: section "Multi-unit Namespaces" > unit MyCompany.ProjectX.ProgramY.Unit1 > unit MyCompany.ProjectX.ProgramY.Unit2 > > "In this example, the namespace MyCompany.ProjectX.ProgramY logically contains all of the interface symbols from unit1.pas and unit2.pas. > > Symbol names in a namespace must be unique, across all units in the namespace. In the example above, it is an error for Unit1 and Unit2 to both define a global interface symbol named mySymbol. " We're talking about one and the same feature. FPC's dotted unit names are implemented based on Delphi's namespace feature, but since they aren't namespaces in the strict sense we prefer to use the more accurate name of "dotted unit names".

What do you make about the piece of code that Dimitry quoted ( "in this..) ?

I tried to read the link above, but it doesn't explicitly say that you can import "mycompany.projectx.projecty" (and that the system then must figure out what units belong to that).

I wonder if this text is a Delphi.NET leftover.

Reply by email

Sven Barth
to Marco van de Voort
Marco van de Voort wrote 27 lines
In our previous episode, Sven Barth said: >> See: > http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/usingnamespaces_xml.html >> >> For example: section "Multi-unit Namespaces" >> unit MyCompany.ProjectX.ProgramY.Unit1 >> unit MyCompany.ProjectX.ProgramY.Unit2 >> >> "In this example, the namespace MyCompany.ProjectX.ProgramY logically > contains all of the interface symbols from unit1.pas and unit2.pas. >> >> Symbol names in a namespace must be unique, across all units in the > namespace. In the example above, it is an error for Unit1 and Unit2 to both > define a global interface symbol named mySymbol. " > > We're talking about one and the same feature. FPC's dotted unit names are > implemented based on Delphi's namespace feature, but since they aren't > namespaces in the strict sense we prefer to use the more accurate name of > "dotted unit names". What do you make about the piece of code that Dimitry quoted ( "in this..) ? I tried to read the link above, but it doesn't explicitly say that you can import "mycompany.projectx.projecty" (and that the system then must figure out what units belong to that). I wonder if this text is a Delphi.NET leftover.

That's the conclusion I had made a long time ago as well. (Native) Delphi definitely does *not* support the uses of a super namespace.

Regards,
Sven

Reply by email

Marco van de Voort
to Sven Barth

In our previous episode, Sven Barth said:

Show quoted text 11 lines
> > What do you make about the piece of code that Dimitry quoted ( "in this..) ? > > I tried to read the link above, but it doesn't explicitly say that you can > import "mycompany.projectx.projecty" (and that the system then must figure > out what units belong to that). > > I wonder if this text is a Delphi.NET leftover. That's the conclusion I had made a long time ago as well. (Native) Delphi definitely does *not* support the uses of a super namespace.

I only thought about the following after that, but an explicit

Uses System;

would be quite problematic otherwise :-)

Reply by email