On Thu, 16 Jul 2015 00:18:30 +
seashell86 via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
So I've been mostly just toying around with D as it seems like it
will end up being a strong language for game development both now
and even moreso in the future. That being said,
On 2015-07-16 09:46, Jonathan M Davis via Digitalmars-d-learn wrote:
I've never heard of a language that overloaded member variables, and given
how class polymorphism works, I don't see how it would even be possible
without making it so that all accesses to a variable actually call a
function
On Thursday, July 16, 2015 01:20:10 seashell86 via Digitalmars-d-learn wrote:
On Thursday, 16 July 2015 at 00:39:29 UTC, H. S. Teoh wrote:
On Thu, Jul 16, 2015 at 12:18:30AM +, seashell86 via
Digitalmars-d-learn wrote:
[...]
The reason is that class variables cannot be overridden,
On Thursday, 16 July 2015 at 00:39:29 UTC, H. S. Teoh wrote:
If you want to simulate overriding of class variables, you can
use a @property method instead:
class Animal {
@property string voice() { return Wah!; }
void speak() { writeln(voice); }
On Thursday, 16 July 2015 at 00:39:29 UTC, H. S. Teoh wrote:
On Thu, Jul 16, 2015 at 12:18:30AM +, seashell86 via
Digitalmars-d-learn wrote:
[...]
The reason is that class variables cannot be overridden, only
class methods can.
If you want to simulate overriding of class variables, you
So I've been mostly just toying around with D as it seems like it
will end up being a strong language for game development both now
and even moreso in the future. That being said, I'm perplexed by
using this code and not receiving the result I would imagine.
Here is the source code of a basic
On Thu, Jul 16, 2015 at 12:18:30AM +, seashell86 via Digitalmars-d-learn
wrote:
So I've been mostly just toying around with D as it seems like it will
end up being a strong language for game development both now and even
moreso in the future. That being said, I'm perplexed by using this