www.digitalmars.com         C & C++   DMDScript  

D - I don't remember: Namespaces?

reply Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
Will D include namespaces?

--
The Villagers are Online! villagersonline.com

.[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
.[ (a version.of(English).(precise.more)) is(possible) ]
?[ you want.to(help(develop(it))) ]
Oct 30 2001
parent reply "Walter" <walter digitalmars.com> writes:
A different way of doing the same thing - modules and imports.

"Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
news:3BDF4861.A2CE31C7 deming-os.org...
 Will D include namespaces?

 --
 The Villagers are Online! villagersonline.com

 .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
 .[ (a version.of(English).(precise.more)) is(possible) ]
 ?[ you want.to(help(develop(it))) ]

Oct 31 2001
parent reply Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
So say I'm playing around with a preliminary (proposed) class library,
and I declare a "net" module.  If modules work like namespaces, then I
can declare a class "Socket" which would be accessible from other
modules with "net.Socket" but within net by "Socket".  Also, Socket
would not conflict with other declarations of other classes called
Socket (unless we are "using" both modules).

Is this how it works, or something different?



Walter wrote:

 A different way of doing the same thing - modules and imports.

 "Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
 news:3BDF4861.A2CE31C7 deming-os.org...
 Will D include namespaces?

 --
 The Villagers are Online! villagersonline.com

 .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
 .[ (a version.of(English).(precise.more)) is(possible) ]
 ?[ you want.to(help(develop(it))) ]


-- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]
Nov 01 2001
parent reply "Walter" <walter digitalmars.com> writes:
That's essentially correct. But there is no "using" declaration in D. If
there are no ambiguities, you can avoid net.Socket and just use Socket. If
there are ambiguities (Socket is declared in more than one module), the
compiler will issue an error, and you'll need to use net.Socket.

"Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
news:3BE177E3.8FF4B09C deming-os.org...
 So say I'm playing around with a preliminary (proposed) class library,
 and I declare a "net" module.  If modules work like namespaces, then I
 can declare a class "Socket" which would be accessible from other
 modules with "net.Socket" but within net by "Socket".  Also, Socket
 would not conflict with other declarations of other classes called
 Socket (unless we are "using" both modules).

 Is this how it works, or something different?



 Walter wrote:

 A different way of doing the same thing - modules and imports.

 "Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
 news:3BDF4861.A2CE31C7 deming-os.org...
 Will D include namespaces?

 --
 The Villagers are Online! villagersonline.com

 .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
 .[ (a version.of(English).(precise.more)) is(possible) ]
 ?[ you want.to(help(develop(it))) ]


-- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]

Nov 01 2001
parent Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
I like :)

--
The Villagers are Online! villagersonline.com

.[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
.[ (a version.of(English).(precise.more)) is(possible) ]
?[ you want.to(help(develop(it))) ]
Nov 01 2001