Re: Many questions

2009-05-09 Thread Jesse Phillips
On Mon, 04 May 2009 18:23:50 -0700, Robert Fraser wrote: Daniel Keep wrote: Also Namespaces can use upper case characters... documentation indicates that package and module names should be written all in lower case. Oh what rubbish. You can use whatever case you please. On Windows

Re: Many questions

2009-05-06 Thread Denis Koroskin
On Wed, 06 May 2009 02:36:21 +0400, Christopher Wright dhase...@gmail.com wrote: I see no use case for having one module in multiple files, though -- the only benefit would be private access to things defined in other files. I've never been big on making stuff private, though. There is a

Re: Many questions

2009-05-06 Thread grauzone
I don't want to split a big class into several smaller classes, just to be able to distribute it across several source files. Actually, the D module system makes me to implement several aspects of something as several classes. Just to be able to put the implementation into several files. Of

Re: Many questions

2009-05-06 Thread Christopher Wright
Denis Koroskin wrote: On Wed, 06 May 2009 02:36:21 +0400, Christopher Wright dhase...@gmail.com wrote: I see no use case for having one module in multiple files, though -- the only benefit would be private access to things defined in other files. I've never been big on making stuff private,

Re: Many questions

2009-05-05 Thread Yigal Chripun
Christopher Wright wrote: Fractal wrote: That's debatable. The hateful thing about namespaces is that they give you absolutely ZERO clue as to where any particular thing is coming from. If I see tango.io.device.File, I know exactly where the source for that module is. -- Daniel Yes it

Re: Many questions

2009-05-05 Thread Denis Koroskin
On Tue, 05 May 2009 09:50:24 +0400, Yigal Chripun yigal...@gmail.com wrote: bearophile wrote: Yigal Chripun: the downside to the current system is when you have one class in a file, the full name of it will be SomeClass.SomeClass instead of just SomeClass. (because of the redundancy of the

Re: Many questions

2009-05-05 Thread Georg Wrede
Yigal Chripun wrote: *but*, I do think that splitting one file that got too big over time or uniting a bunch of small files into one should be possible. This would be especially good for us. D is mainly developed by individuals, and there projects tend to grow organically -- as opposed to

Re: Many questions

2009-05-05 Thread Christopher Wright
Georg Wrede wrote: Yigal Chripun wrote: *but*, I do think that splitting one file that got too big over time or uniting a bunch of small files into one should be possible. This would be especially good for us. D is mainly developed by individuals, and there projects tend to grow organically

Re: Many questions

2009-05-05 Thread grauzone
Christopher Wright wrote: Georg Wrede wrote: Yigal Chripun wrote: *but*, I do think that splitting one file that got too big over time or uniting a bunch of small files into one should be possible. This would be especially good for us. D is mainly developed by individuals, and there

Re: Many questions

2009-05-05 Thread Christopher Wright
grauzone wrote: Christopher Wright wrote: It *is* possible, by use of public imports. Are you splitting one file into many? Public import the other modules. Are you merging many files into one? Leave the other files with just a public import of the merged file. Nice story. In reality you

Re: Many questions

2009-05-04 Thread Robert Fraser
Ellery Newcomer wrote: Nick Sabalausky wrote: - //File: foo/fooA.d module foo.fooA; class fooA {} //File: foo/fooB.d module foo.fooB; class fooB {} //File: foo/fooC.d module foo.fooC; class fooC {} //File: foo/all.d module foo.all; public import foo.fooA;

Re: Many questions

2009-05-04 Thread Liang Du
Nick Sabalausky Wrote: Fractal d294...@bsnow.net wrote in message news:gtlihm$tt...@digitalmars.com... The namespaces: i used them with C++, and the idea of separation between the uses of types, makes a very good layout. Because some namespaces requires more types, always i write

Re: Many questions

2009-05-04 Thread BCS
Hello Saaa, mixins are just code in string form, right? No that's mixin(string), there is also mixin Template!(); that plops the template content into its scope.

Re: Many questions

2009-05-04 Thread BCS
Hello Fractal, Templates: i dont use templates or mixins. they really confuses me and i think so that they only should be used for array classes or something similar. I'm biased (as I love playing with them) but templates can be used for a LOT more than that. Most of the time the end user

Re: Many questions

2009-05-04 Thread Saaa
Ah, ok thanks. I should really start reading about those template things :) Hello Saaa, mixins are just code in string form, right? No that's mixin(string), there is also mixin Template!(); that plops the template content into its scope.

Re: Many questions

2009-05-04 Thread Yigal Chripun
Daniel Keep wrote: Liang Du wrote: Nick Sabalausky Wrote: Fractal d294...@bsnow.net wrote in message news:gtlihm$tt...@digitalmars.com... The namespaces: i used them with C++, and the idea of separation between the uses of types, makes a very good layout. Because some namespaces requires

Re: Many questions

2009-05-04 Thread bearophile
Yigal Chripun: the downside to the current system is when you have one class in a file, the full name of it will be SomeClass.SomeClass instead of just SomeClass. (because of the redundancy of the module decl. in this case) Generally if classes or functions are small, you put more than one

Re: Many questions

2009-05-04 Thread Fractal
That's debatable. The hateful thing about namespaces is that they give you absolutely ZERO clue as to where any particular thing is coming from. If I see tango.io.device.File, I know exactly where the source for that module is. -- Daniel Yes it is true. But the thing is not where is

Re: Many questions

2009-05-04 Thread bearophile
Fractal: Really module, packages, and namespaces are the same thing. Not really :-) There are semantic differences. Bye, bearophile

Re: Many questions

2009-05-04 Thread Daniel Keep
Fractal wrote: That's debatable. The hateful thing about namespaces is that they give you absolutely ZERO clue as to where any particular thing is coming from. If I see tango.io.device.File, I know exactly where the source for that module is. -- Daniel Yes it is true. But the thing

Re: Many questions

2009-05-04 Thread Robert Fraser
Daniel Keep wrote: Also Namespaces can use upper case characters... documentation indicates that package and module names should be written all in lower case. Oh what rubbish. You can use whatever case you please. On Windows (actually NTFS, I think), you can't two packages/modules that

Re: Many questions

2009-05-04 Thread Christopher Wright
Fractal wrote: That's debatable. The hateful thing about namespaces is that they give you absolutely ZERO clue as to where any particular thing is coming from. If I see tango.io.device.File, I know exactly where the source for that module is. -- Daniel Yes it is true. But the thing is not

Many questions

2009-05-03 Thread Fractal
Hello After using the D1 language i have some questions about it: - Why i cant use many files with the same module name? I want to use modules like .NET or C++ namespaces and the file has 10K lines and finding a line takes many time... - Why there is no ranged foreach in D1? - Why there is

Re: Many questions

2009-05-03 Thread Robert Fraser
Fractal wrote: - Why i cant use many files with the same module name? I want to use modules like .NET or C++ namespaces and the file has 10K lines and finding a line takes many time... Errr... no offense, but that kinda sounds like a bad design... - Why there is no ranged foreach in D1?

Re: Many questions

2009-05-03 Thread Daniel Keep
Fractal wrote: Hello After using the D1 language i have some questions about it: - Why i cant use many files with the same module name? I want to use modules like .NET or C++ namespaces and the file has 10K lines and finding a line takes many time... Because in D, the module name

Re: Many questions

2009-05-03 Thread dsimcha
== Quote from Fractal (d294...@bsnow.net)'s article Hello After using the D1 language i have some questions about it: - Why i cant use many files with the same module name? I want to use modules like .NET or C++ namespaces and the file has 10K lines and finding a line takes many time... If I

Re: Many questions

2009-05-03 Thread bearophile
Hello, and welcome Fractal. I can give you some answers; other people will fill the missing ones. I can see you come from C#. D isn't C#, and not everything C# does differently from D is an mistake of the D design. Sometimes it's just a different way to do things, sometimes it's a design that

Re: Many questions

2009-05-03 Thread Saaa
interface I { void shine(); } class C : I { final void shine() { } } void main() { C c = new C(); I i = c; I didn't know an interface could hold the data of an class or am I seeing this wrong? i.shine(); // Virtual c.shine(); // Direct }

Re: Many questions

2009-05-03 Thread Fractal
Hello again... Thanks for the quick responses! and sorry... if my english is very bad :) C#: No, i dont have been used C# for anything. But i like the .NET framework structure. How ever not at all (it also uses interfaces). The namespaces: i used them with C++, and the idea of separation

Re: Many questions

2009-05-03 Thread Saaa
Templates: i dont use templates or mixins. they really confuses me and i think so that they only should be used for array classes or something similar. Do you mean you don't understand the concept of mixins or that it makes reading the code more difficult? If it is the first then I don't

Re: Many questions

2009-05-03 Thread Fractal
Saaa Wrote: Templates: i dont use templates or mixins. they really confuses me and i think so that they only should be used for array classes or something similar. Do you mean you don't understand the concept of mixins or that it makes reading the code more difficult? If it is the

Re: Many questions

2009-05-03 Thread Fractal
Saaa Wrote: Templates: i dont use templates or mixins. they really confuses me and i think so that they only should be used for array classes or something similar. Do you mean you don't understand the concept of mixins or that it makes reading the code more difficult? If it is the

Re: Many questions

2009-05-03 Thread Saaa
; ) But I understand where you are coming from. Please ask as many questions as you want. They teach me as well :)

Re: Many questions

2009-05-03 Thread Fractal
with a systems programming language ; ) But I understand where you are coming from. Please ask as many questions as you want. They teach me as well :) D is for me a very good language. At the time everything that i want to do, is possible with it. And i have deleted all the C++ code and replaced

Re: Many questions

2009-05-03 Thread Nick Sabalausky
Fractal d294...@bsnow.net wrote in message news:gtlihm$tt...@digitalmars.com... The namespaces: i used them with C++, and the idea of separation between the uses of types, makes a very good layout. Because some namespaces requires more types, always i write each class in separate files. D

Re: Many questions

2009-05-03 Thread superdan
Fractal Wrote: D is for me a very good language. At the time everything that i want to do, is possible with it. And i have deleted all the C++ code and replaced it with D. here's 1 happy dood without a legacy code problem. boy how i miss kindergarten. welcome 2 da club kiddo.

Re: Many questions

2009-05-03 Thread Ellery Newcomer
Nick Sabalausky wrote: - //File: foo/fooA.d module foo.fooA; class fooA {} //File: foo/fooB.d module foo.fooB; class fooB {} //File: foo/fooC.d module foo.fooC; class fooC {} //File: foo/all.d module foo.all; public import foo.fooA; public import foo.fooB;