Re: How to break module into multiple file.

2011-05-23 Thread Andrew Wiley
On Mon, May 23, 2011 at 4:39 AM, Matthew Ong wrote: > On 5/23/2011 3:58 PM, Timon Gehr wrote: > >> On 2011-05-23 00:09, Matthew Ong wrote: >> > > Thanks everyone that gave some working model to a newbie from Java Space. > > I found the working file layout model from dwt2 > http://hg.dsource.org/p

Re: How to break module into multiple file.

2011-05-23 Thread Matthew Ong
On 5/23/2011 3:58 PM, Timon Gehr wrote: On 2011-05-23 00:09, Matthew Ong wrote: Thanks everyone that gave some working model to a newbie from Java Space. I found the working file layout model from dwt2 http://hg.dsource.org/projects/dwt2 There is a dwt2\base\src Haha. That is exactly like wh

Re: How to break module into multiple file.

2011-05-23 Thread Timon Gehr
On 2011-05-23 00:09, Matthew Ong wrote: > On 5/21/2011 7:16 PM, Russel Winder wrote: > > On Sat, 2011-05-21 at 04:35 -0400, Nick Sabalausky wrote: > > [ . . . ] > > > >> Subversion handles multiple people editing the same file perfectly fine. > >> But Hg probably is better than SVN, overall. I've b

Re: How to break module into multiple file.

2011-05-23 Thread Jonathan M Davis
On 2011-05-23 00:09, Matthew Ong wrote: > On 5/21/2011 7:16 PM, Russel Winder wrote: > > On Sat, 2011-05-21 at 04:35 -0400, Nick Sabalausky wrote: > > [ . . . ] > > > >> Subversion handles multiple people editing the same file perfectly fine. > >> But Hg probably is better than SVN, overall. I've

Re: How to break module into multiple file.

2011-05-23 Thread Matthew Ong
On 5/21/2011 7:16 PM, Russel Winder wrote: On Sat, 2011-05-21 at 04:35 -0400, Nick Sabalausky wrote: [ . . . ] Subversion handles multiple people editing the same file perfectly fine. But Hg probably is better than SVN, overall. I've been a happy SVN user for a long time, but even I'm starting t

Re: How to break module into multiple file.

2011-05-21 Thread Russel Winder
On Sat, 2011-05-21 at 04:35 -0400, Nick Sabalausky wrote: [ . . . ] > Subversion handles multiple people editing the same file perfectly fine. But > Hg probably is better than SVN, overall. I've been a happy SVN user for a > long time, but even I'm starting to get won over by Hg. Of course, some

Re: How to break module into multiple file.

2011-05-21 Thread Nick Sabalausky
"Matthew Ong" wrote in message news:ir7qio$28mn$1...@digitalmars.com... > On 5/20/2011 4:23 AM, Nick Sabalausky wrote: >> "Matthew Ong" wrote in message >> news:ir3801$84b$1...@digitalmars.com... >>> >>> As for the real reason it is for: >>> That current D layout seem to limit that one file to a

Re: How to break module into multiple file.

2011-05-21 Thread Matthew Ong
On 5/20/2011 4:23 AM, Nick Sabalausky wrote: "Matthew Ong" wrote in message news:ir3801$84b$1...@digitalmars.com... On 5/14/2011 3:17 AM, Nick Sabalausky wrote: "Jason House" wrote in message But yea, one-class-per-file is really a Java thing (and then a few other Not true entirely, the

Re: How to break module into multiple file.

2011-05-19 Thread Nick Sabalausky
"Matthew Ong" wrote in message news:ir3801$84b$1...@digitalmars.com... > On 5/14/2011 3:17 AM, Nick Sabalausky wrote: >> "Jason House" wrote in message > > > But yea, one-class-per-file is really a Java thing (and then a few other > Not true entirely, the limit is one public class per file. Ther

Re: How to break module into multiple file.

2011-05-19 Thread Matthew Ong
On 5/14/2011 3:17 AM, Nick Sabalausky wrote: "Jason House" wrote in message > But yea, one-class-per-file is really a Java thing (and then a few other Not true entirely, the limit is one public class per file. There is no actual limit for such: // The file must be ClassA.java public class C

Re: How to break module into multiple file.

2011-05-18 Thread Adam Burton
Alexander wrote: > On 18.05.2011 19:10, Jonathan M Davis wrote: > >> What D does is completely normal and common. It just doesn't match Java >> and C#. > > To be honest, I didn't see any single source file with ca. 3 lines > in it (like std.datetime) for quite a while :) > > Probably,

Re: How to break module into multiple file.

2011-05-18 Thread Adam Burton
Jonathan M Davis wrote: >> On 5/13/2011 3:51 PM, Alexander wrote: >> > On 13.05.2011 00:59, Jonathan M Davis wrote: >> >> Still, I wouldn't have though that dashes would have been a big enough >> >> deal to really care. >> >> >> > I didn't say that this is a "big deal", just "inconvenience". >> >

Re: How to break module into multiple file.

2011-05-18 Thread Jesse Phillips
Matthew Ong Wrote: > I agreed with what alexander is voicing out. How about the process > within a team development. That current D layout seem to limit that one > file to a single developer. Instead of multiple class multiple developer > within the same module. > Using the example: > HashMap &

Re: How to break module into multiple file.

2011-05-18 Thread Alexander
On 18.05.2011 19:10, Jonathan M Davis wrote: > What D does is completely normal and common. It just doesn't match Java and > C#. To be honest, I didn't see any single source file with ca. 3 lines in it (like std.datetime) for quite a while :) Probably, I am old-fashioned, but this amou

Re: How to break module into multiple file.

2011-05-18 Thread Jonathan M Davis
> On 5/13/2011 3:51 PM, Alexander wrote: > > On 13.05.2011 00:59, Jonathan M Davis wrote: > >> Still, I wouldn't have though that dashes would have been a big enough > >> deal to really care. > >> > > I didn't say that this is a "big deal", just "inconvenience". > > > > There are many minor thing

Re: How to break module into multiple file.

2011-05-18 Thread Matthew Ong
On 5/13/2011 3:51 PM, Alexander wrote: On 13.05.2011 00:59, Jonathan M Davis wrote: Still, I wouldn't have though that dashes would have been a big enough deal to really care. I didn't say that this is a "big deal", just "inconvenience". There are many minor things which are not a big

Re: How to break module into multiple file.

2011-05-13 Thread Nick Sabalausky
"Jason House" wrote in message news:iqjamt$1e5b$1...@digitalmars.com... >I wonder a bit why you want one file per object? Is it to avoid unnecessary >imports? Make finding object definitions easier? Or a style preference? I >think replies by others covered all but the first question. I use the

Re: How to break module into multiple file.

2011-05-13 Thread Jason House
I wonder a bit why you want one file per object? Is it to avoid unnecessary imports? Make finding object definitions easier? Or a style preference? I think replies by others covered all but the first question. I use the "import std.foo: bar, baz;" syntax for that. Generally speaking, separating

Re: How to break module into multiple file.

2011-05-13 Thread Alexander
On 13.05.2011 00:59, Jonathan M Davis wrote: > Still, I wouldn't have though that dashes would have been a big enough deal > to really care. I didn't say that this is a "big deal", just "inconvenience". There are many minor things which are not a big deal, but make life a bit less convenie

Re: How to break module into multiple file.

2011-05-12 Thread Nick Sabalausky
"Alexander" wrote in message news:iqh6gk$hpn$1...@digitalmars.com... > On 12.05.2011 17:05, Jonathan M Davis wrote: > >> A module is always one file and only one file. > > ...which could be really, really big due to this limitation > (std.datetime), and this is not always convenient sometimes -

Re: How to break module into multiple file.

2011-05-12 Thread Jonathan M Davis
> On 12.05.2011 20:34, Jonathan M Davis wrote: > > It's generally easy for _you_ to find them too, because the import tells > > you where they are (the fact that you can have multiply directories > > being searched for imports being the main complicating factor). It's > > what pretty much any D pro

Re: How to break module into multiple file.

2011-05-12 Thread Alexander
On 12.05.2011 20:34, Jonathan M Davis wrote: > It's generally easy for _you_ to find them too, because the import tells you > where > they are (the fact that you can have multiply directories being searched for > imports being the main complicating factor). It's what pretty much any D > progra

Re: How to break module into multiple file.

2011-05-12 Thread Nick Sabalausky
"Matthew Ong" wrote in message news:iqgnj9$2n0j$1...@digitalmars.com... > Hi, > > According to: > http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=135947 > > And also source code within dmd2/src > It seems that there is only one file per module. > >

Re: How to break module into multiple file.

2011-05-12 Thread Jonathan M Davis
> > For small projects this is OK, but for large - not quite, IMHO. > > I don't know about that. I always compile everything at once > now - in my experience, it's negligibly slower than linking alone. > > druntime: compiled all at once takes ~1 second on my box. 65k lines of > (light) code. > >

Re: How to break module into multiple file.

2011-05-12 Thread Robert Clipsham
On 12/05/2011 19:25, Adam Ruppe wrote: Maybe million line programs will be unacceptably slow, but I don't know, I'd have to actually see it being a problem in practice before I get worked up about it. tbh I wouldn't be surprised if the incremental build was actually slower than the all at once in

Re: How to break module into multiple file.

2011-05-12 Thread Adam Ruppe
> For small projects this is OK, but for large - not quite, IMHO. I don't know about that. I always compile everything at once now - in my experience, it's negligibly slower than linking alone. druntime: compiled all at once takes ~1 second on my box. 65k lines of (light) code. phobos: compiled

Re: How to break module into multiple file.

2011-05-12 Thread Alexander
On 12.05.2011 19:53, Adam Ruppe wrote: > If you use the module declaration at the top of the file and manually > list the files on the command line, the file and directory names don't > matter. Right, but this, in turn, forces me to recompile all of my modules after every change, no matter whe

Re: How to break module into multiple file.

2011-05-12 Thread Adam Ruppe
> so I couldn't have different namespaces (on different levels) in > single directory, and this also forces me to match file > name with module name. No, it doesn't. You're right that it splits when it searches, but it doesn't *have* to search. If you use the module declaration at the top of the

Re: How to break module into multiple file.

2011-05-12 Thread Alexander
On 12.05.2011 17:05, Jonathan M Davis wrote: > A module is always one file and only one file. ...which could be really, really big due to this limitation (std.datetime), and this is not always convenient sometimes - that's why I like the idea of namespaces and partial classes. There is ano

Re: How to break module into multiple file.

2011-05-12 Thread Jonathan M Davis
On 2011-05-12 06:33, Matthew Ong wrote: > Hi, > > According to: > http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group > =digitalmars.D&artnum=135947 > > And also source code within dmd2/src > It seems that there is only one file per module. > > Is module similar to a sing

Re: How to break module into multiple file.

2011-05-12 Thread Matthew Ong
Hi Adam, Ok. Just to be very clear here. Please help to validate. >Common interfaces for both HashMap, LinkedList and hashlist. >But they should be all be in different source file(HashMap.d, >LinkedList.d, HashList.d).. To have import for: module CornerCube.Collections class HashMap{...} I w

Re: How to break module into multiple file.

2011-05-12 Thread Adam Ruppe
Use folders as a collection of modules. foo/bar.d => import foo.bar; You don't actually have to separate them into folders - the directory layout is up to you. But this is the simplest method. Learn more here: http://digitalmars.com/d/2.0/module.html

How to break module into multiple file.

2011-05-12 Thread Matthew Ong
Hi, According to: http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=135947 And also source code within dmd2/src It seems that there is only one file per module. Is module similar to a single java package and namespace in VC++/C#? If yes, most name