Re: distinguish between classes and structures

2008-12-15 Thread Weed
Bill Baxter пишет: 2008/12/16 Weed : Frits van Bommel пишет: Weed wrote: In C++, we had the problem - "slicing" objects. In D this problem is solved inability to inherit from structs. Without inheritance of structs many things are not possible, compared with C++. Why, instead of the complete i

Re: distinguish between classes and structures

2008-12-15 Thread Weed
Bill Baxter пишет: 2008/12/16 Weed : Frits van Bommel пишет: Weed wrote: In C++, we had the problem - "slicing" objects. In D this problem is solved inability to inherit from structs. Without inheritance of structs many things are not possible, compared with C++. Why, instead of the complete i

Re: distinguish between classes and structures

2008-12-15 Thread Bill Baxter
2008/12/16 Weed : > Frits van Bommel пишет: >> >> Weed wrote: >>> >>> In C++, we had the problem - "slicing" objects. >>> In D this problem is solved inability to inherit from structs. >>> Without inheritance of structs many things are not possible, compared >>> with C++. >>> Why, instead of the co

Re: distinguish between classes and structures

2008-12-15 Thread Weed
Frits van Bommel пишет: Weed wrote: In C++, we had the problem - "slicing" objects. In D this problem is solved inability to inherit from structs. Without inheritance of structs many things are not possible, compared with C++. Why, instead of the complete inability to inherit, just do not make

Re: distinguish between classes and structures

2008-12-15 Thread Weed
Kagamin пишет: Weed Wrote: Without inheritance of structs many things are not possible, compared with C++. for example? it is impossible to create the struct of the object which will be arbitrary size (raised by a user) + to be able to set compile-time + should work with the struc

Re: distinguish between classes and structures

2008-12-15 Thread Weed
Frits van Bommel пишет: Weed wrote: In C++, we had the problem - "slicing" objects. In D this problem is solved inability to inherit from structs. Without inheritance of structs many things are not possible, compared with C++. Why, instead of the complete inability to inherit, just do not make

Re: Struct life time

2008-12-15 Thread Qian Xu
BCS wrote: Reply to Qian, Hi All, I am new to D community. I have some problems with TimeOfDay struct. I have defined a class: class Test { TimeOfDay* getTime() { return a_valid_timeofday_pointer; } Could you expand on this function?

Re: plain C to D2 const etc:

2008-12-15 Thread BLS
Denis Koroskin schrieb: On Mon, 15 Dec 2008 20:11:44 +0300, BLS wrote: Hi, what is the correct way to translate this snippet into _D2_ ? //const and cast() void rc2_decrypt( const unsigned short xkey[64], unsigned char *plain, const unsigned char *cipher

Re: plain C to D2 const etc:

2008-12-15 Thread Denis Koroskin
On Mon, 15 Dec 2008 20:11:44 +0300, BLS wrote: Hi, what is the correct way to translate this snippet into _D2_ ? //const and cast() void rc2_decrypt( const unsigned short xkey[64], unsigned char *plain, const unsigned char *cipher ) { uns

plain C to D2 const etc:

2008-12-15 Thread BLS
Hi, what is the correct way to translate this snippet into _D2_ ? //const and cast() void rc2_decrypt( const unsigned short xkey[64], unsigned char *plain, const unsigned char *cipher ) { unsigned x76, x54, x32, x10, i; x76 = (cipher[7]

Re: distinguish between classes and structures

2008-12-15 Thread Frits van Bommel
Weed wrote: In C++, we had the problem - "slicing" objects. In D this problem is solved inability to inherit from structs. Without inheritance of structs many things are not possible, compared with C++. Why, instead of the complete inability to inherit, just do not make impossible to up casting

Re: distinguish between classes and structures

2008-12-15 Thread Kagamin
Weed Wrote: > Without inheritance of structs many things are not possible, compared > with C++. for example?

Re: distinguish between classes and structures

2008-12-15 Thread Weed
Weed пишет: Why, instead of the complete inability to inherit, just do not make impossible to up casting struct type by value. It's a question: Why, instead of the complete inability to inherit, just do not make impossible to up casting struct type by value?

Re: Template mixin problem

2008-12-15 Thread Olli Aalto
Bill Baxter wrote: On Mon, Dec 15, 2008 at 5:58 PM, Olli Aalto wrote: Bill Baxter wrote: On Mon, Dec 15, 2008 at 5:48 PM, Olli Aalto wrote: Ok, downs figured it out on #D. You can't have mixins in templates, which is a big disappointment. Removing the HelloData mixin from HelloSpeaker and a

Re: Template mixin problem

2008-12-15 Thread Bill Baxter
On Mon, Dec 15, 2008 at 5:58 PM, Olli Aalto wrote: > Bill Baxter wrote: >> >> On Mon, Dec 15, 2008 at 5:48 PM, Olli Aalto wrote: >>> >>> Ok, downs figured it out on #D. You can't have mixins in templates, which >>> is >>> a big disappointment. >>> >>> Removing the HelloData mixin from HelloSpeake

Re: distinguish between classes and structures

2008-12-15 Thread Weed
Bill Baxter пишет: 2008/12/15 Weed : Bill Baxter пишет: On Mon, Dec 15, 2008 at 3:35 PM, Weed wrote: Who can provide a link to an explanation about why in D has taken to distinguish between classes and structures? (Sorry for my bad English) The main justification is eliminating the slicing

Re: Template mixin problem

2008-12-15 Thread Olli Aalto
Bill Baxter wrote: On Mon, Dec 15, 2008 at 5:48 PM, Olli Aalto wrote: Ok, downs figured it out on #D. You can't have mixins in templates, which is a big disappointment. Removing the HelloData mixin from HelloSpeaker and all references to helloStr it "works". Hmm, didn't know that. But also

Re: Template mixin problem

2008-12-15 Thread Bill Baxter
On Mon, Dec 15, 2008 at 5:48 PM, Olli Aalto wrote: > Ok, downs figured it out on #D. You can't have mixins in templates, which is > a big disappointment. > > Removing the HelloData mixin from HelloSpeaker and all references to > helloStr it "works". Hmm, didn't know that. But also if you import

Re: Template mixin problem

2008-12-15 Thread Olli Aalto
Ok, downs figured it out on #D. You can't have mixins in templates, which is a big disappointment. Removing the HelloData mixin from HelloSpeaker and all references to helloStr it "works". O.

Template mixin problem

2008-12-15 Thread Olli Aalto
I already posed this question on the #D channel, but here's for the rest of you. http://tango.pastebin.com/m59b8715f Here's the error: oaalto-desktop Projects/workspace/MixinTest> dsss build mixins/main.d => mixin_test mixins/HelloWorld.d(7): mixin is not defined mixins/HelloWorld.d(8): mixin

Re: distinguish between classes and structures

2008-12-15 Thread Bill Baxter
2008/12/15 Weed : > Weed пишет: >> >> Bill Baxter пишет: >>> >>> On Mon, Dec 15, 2008 at 3:35 PM, Weed wrote: Who can provide a link to an explanation about why in D has taken to distinguish between classes and structures? (Sorry for my bad English) >>> >>> The main j

Re: distinguish between classes and structures

2008-12-15 Thread Bill Baxter
2008/12/15 Weed : > Bill Baxter пишет: >> >> On Mon, Dec 15, 2008 at 3:35 PM, Weed wrote: >>> >>> Who can provide a link to an explanation about why in D has taken to >>> distinguish between classes and structures? >>> >>> (Sorry for my bad English) >>> >> >> The main justification is eliminating

Re: distinguish between classes and structures

2008-12-15 Thread Weed
Weed пишет: Bill Baxter пишет: On Mon, Dec 15, 2008 at 3:35 PM, Weed wrote: Who can provide a link to an explanation about why in D has taken to distinguish between classes and structures? (Sorry for my bad English) The main justification is eliminating the slicing problem. http://cplusplu