Re: Accessing class with module name as Java's

2015-01-13 Thread tcak via Digitalmars-d-learn
Ah, I just re-read your OP. Your already at this point :) Since everybody has understood the problem, and nobody could have come up with a solution yet, my idea is that: HttpSocketConnectionRequest.d = module net.http.HttpSocketConnectionRequest; module

Re: Accessing class with module name as Java's

2015-01-13 Thread Colin via Digitalmars-d-learn
Have the following directory structure? ~/testModule$ find . -print . ./net ./net/http_.d# ** ./net/http ./net/http/Mod1.d ./net/http/Mod2.d ./main.d ** I put the _ here to make it seperate from the net/http directory. Probably, a better solution exists, this was hacked together quickly :)

Re: Accessing class with module name as Java's

2015-01-13 Thread Colin via Digitalmars-d-learn
On Tuesday, 13 January 2015 at 09:22:04 UTC, Colin wrote: Have the following directory structure? ~/testModule$ find . -print . ./net ./net/http_.d# ** ./net/http ./net/http/Mod1.d ./net/http/Mod2.d ./main.d ** I put the _ here to make it seperate from the net/http directory. Probably, a

Re: Accessing class with module name as Java's

2015-01-13 Thread Daniel Kozák via Digitalmars-d-learn
V Tue, 13 Jan 2015 10:58:27 + tcak via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsáno: Ah, I just re-read your OP. Your already at this point :) Since everybody has understood the problem, and nobody could have come up with a solution yet, my idea is that:

Re: Accessing class with module name as Java's

2015-01-12 Thread tcak via Digitalmars-d-learn
On Monday, 12 January 2015 at 18:11:35 UTC, bearophile wrote: D modules can contain lot of stuff, like variables, constants, enums, types, structs, etc. And you usually put more than one class in each D module. Also D class names should be capitalized (like Project). When I do this, it

Re: Accessing class with module name as Java's

2015-01-12 Thread Ali Çehreli via Digitalmars-d-learn
On 01/12/2015 10:09 PM, tcak wrote: It is just making everything dirty. request.HttpSocketConnectionRequest connection.HttpSocketConnection You can name the files the same as their classes: HttpSocketConnectionRequest.d, etc. I just want to create a file called

Re: Accessing class with module name as Java's

2015-01-12 Thread tcak via Digitalmars-d-learn
What namespace? D has modules, unlike C++. In general it's a bad idea to have inside a module a name (like a variable name or struct name) equal to the module name, because it causes confusion. I am confused as well. core.stdc.errno @property int errno() { return getErrno(); } @property int

Re: Accessing class with module name as Java's

2015-01-12 Thread tcak via Digitalmars-d-learn
On Tuesday, 13 January 2015 at 05:18:46 UTC, Ali Çehreli wrote: On 01/12/2015 08:22 PM, tcak wrote: What namespace? D has modules, unlike C++. In general it's a bad idea to have inside a module a name (like a variable name or struct name) equal to the module name, because it causes confusion.

Re: Accessing class with module name as Java's

2015-01-12 Thread Ali Çehreli via Digitalmars-d-learn
On 01/12/2015 08:22 PM, tcak wrote: What namespace? D has modules, unlike C++. In general it's a bad idea to have inside a module a name (like a variable name or struct name) equal to the module name, because it causes confusion. I am confused as well. core.stdc.errno @property int

Re: Accessing class with module name as Java's

2015-01-12 Thread bearophile via Digitalmars-d-learn
tcak: One way I achieved it, though I cannot put namespace on it. file: project.d == module project; class project{} D modules can contain lot of stuff, like variables, constants, enums, types, structs, etc. And you usually put more than one class in each D module. Also D

Accessing class with module name as Java's

2015-01-12 Thread tcak via Digitalmars-d-learn
In java, if I create a file, the class that is defined in it must have the same name of file. So, with the file name, I can relate to class directly. Is there any way to achieve this in D? One way I achieved it, though I cannot put namespace on it. file: project.d == module