Re: On inheritance and polymorphism in cats and dogs (and other beasts too)

2014-12-21 Thread Derix via Digitalmars-d-learn
Thank you kindly for this detailed response. Your directions bore frution, and I now have cats that breed cats (and not dogs). However I can't get rid of the following warning on compilation : |... | void mixGenetics(Cat mother,Cat father) {...} |... Warning: Beast.Beast.mixGenetics(Beast

Re: On inheritance and polymorphism in cats and dogs (and other beasts too)

2014-12-21 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 21 December 2014 at 15:05:47 UTC, Mike Parker wrote: // Now do Catty things pickiness = (mother.pickiness + father.pickiness) / 2; Sorry, forgot to change that line when I copy-pasted. Should be: pickiness = (catmom.pickiness + catdad.pickiness) / 2;

Re: On inheritance and polymorphism in cats and dogs (and other beasts too)

2014-12-21 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 21 December 2014 at 10:42:37 UTC, Derix wrote: If you change the mother and father parameters from Beasts to Cats, then you aren't overriding anything -- you are /overloading/. That's where the first two errors were coming from. In order for a subclass method to override a base

Re: On inheritance and polymorphism in cats and dogs (and other beasts too)

2014-12-21 Thread Derix via Digitalmars-d-learn
Thanks a lot, I begin to see the light ! you aren't overriding anything -- you are /overloading/ Yep, I rekon the difference was not clear to me. It still isn't right now, but at least now I know that it exists and I have to look into it. As to the spell you cast to my cats in your rewriting

How to Declare a new pragma ?

2014-12-21 Thread FrankLike via Digitalmars-d-learn
I want to get that : pragma(link, SUBSYSTEM WINDOWS,4.0); But get error:pragma link unrecognized pragma(link)? How can I to do? Thank you.

Re: How to Declare a new pragma ?

2014-12-21 Thread ketmar via Digitalmars-d-learn
On Sun, 21 Dec 2014 16:42:45 + FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I want to get that : pragma(link, SUBSYSTEM WINDOWS,4.0); But get error:pragma link unrecognized pragma(link)? How can I to do? Thank you. you have to patch the compiler to

Re: How to Declare a new pragma ?

2014-12-21 Thread FrankLike via Digitalmars-d-learn
On Sunday, 21 December 2014 at 17:04:45 UTC, ketmar via Digitalmars-d-learn wrote: On Sun, 21 Dec 2014 16:42:45 + FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I want to get that : pragma(link, SUBSYSTEM WINDOWS,4.0); But get error:pragma link unrecognized

Re: How to Declare a new pragma ?

2014-12-21 Thread Mike Parker via Digitalmars-d-learn
On 12/22/2014 9:21 AM, FrankLike wrote: Now ,x64 mainform always have the console window,and the entry is main. could you do it? Thank you. Since 64-bit DMD uses the Microsoft toolchain, you need to pass a parameter on the command line to the MS linker. Linker parameters are

Re: On inheritance and polymorphism in cats and dogs (and other beasts too)

2014-12-21 Thread Mike Parker via Digitalmars-d-learn
On 12/22/2014 1:11 AM, Derix wrote: Yep, I rekon the difference was not clear to me. It still isn't right now, but at least now I know that it exists and I have to look into it. Overriding - a subclass reimplements a method from a base class. The method must have the same number and type of