Walter: extend existing classes with new methods?

Chris Nicholson-Sauls ibisbasenji at gmail.com
Mon Sep 4 12:10:25 PDT 2006


Ivan Senji wrote:
> Marcio wrote:
> 
>> No, I am asking for extending at compile-time. Example: You provide me 
>> with a library written in D, with full source, and my app can add 
>> methods to some of your classes. Then I compile the full source.
>>
>> This is quite doable, even in D.
> 
> 
> It sure is. The fact that it isn't implemented is just another 
> inconsistency in the language. I would even go so far and say it is a 
> d1.0blocker (as all inconsistencies are).
> 

Okay... maybe I'm missing something here?  I was pretty sure we already do have this, in a 
little OOP concept called inheritance?  Given a library defining 'class Foo', if I need 
custom behavior, I simply define a 'class MyFoo:Foo' and voila!

Or is there some deeper concept that I'm overlooking entirely?

-- Chris Nicholson-Sauls



More information about the Digitalmars-d mailing list