D versus Objective C Comparison

Michel Fortin michel.fortin at michelf.com
Sat Jan 31 18:53:49 PST 2009


On 2009-01-31 20:51:57 -0500, Chris R Miller 
<lordsauronthegreat at gmail.com> said:

>> If you had a smart enough dynamic linker and the signature of each 
>> function in the virtual table, you could do that in D too by creating 
>> virtual tables and updating offsets in the code accordingly while 
>> linking. (Objective-C doesn't work like that, but it has the same 
>> effect.) Alternativly, it could be done in some static initialisation 
>> phase.
> 
> An increasingly interesting toy to study (I would think) would be 
> Categories - the ability to take an existing class and just randomly 
> tack on additional receivers.  Perhaps this is exclusive to 
> Objective-C's message-receiver architecture, but it's a curious little 
> technology nonetheless.

I'm sure we could add something like categories with what I'm proposing 
above. In fact, many people on this list have requested a way to write 
extensions to classes: more methods you can invoke using the dot 
syntax. Perhaps virtual tables built at runtime could allow people to 
write class extensions and still be able to override extension methods 
in subclasses.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list