Rant after trying Rust a bit

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 24 12:04:30 PDT 2015


On 7/24/2015 11:35 AM, Jacob Carlborg wrote:
> On 2015-07-24 08:42, Walter Bright wrote:
>
>> It's a good question. And the answer is, the top level function does not
>> list every interface used by the call tree. Nested function calls test
>> at runtime if a particular interface is supported by an object, using
>> dynamic casting or QueryInterface() calls. It's fundamentally different
>> from traits and concepts.
>
> If you have an interface and then doing a dynamic cast then you're doing it
> wrong. Yes, I know that there are code that uses this, yes I have done that too.

Dynamic cast is no different from QueryInterface(), which is how it's done, and 
the reason is the point of all this - avoiding needing to enumerate every 
interface needed by the leaves at the root of the call tree.



More information about the Digitalmars-d mailing list