# Aaah yes ... clr interop

**URL:** <https://www.ruby-forum.com/t/aaah-yes-clr-interop/168003>\
**Category:** IronRuby\
**Created:** [May 14, 2009, 9:59pm UTC](https://www.ruby-forum.com/t/aaah-yes-clr-interop/168003 "2009-05-14T21:59:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![barby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c57346/32.png) [@barby](https://www.ruby-forum.com/u/barby)\
**Post date:** [May 14, 2009, 9:59pm UTC](https://www.ruby-forum.com/t/aaah-yes-clr-interop/168003/1 "2009-05-14T21:59:05Z")

</div>

I’m sorry I’ll probably keep hitting all those points while I’m writing  
integration specs.

Ok so would it be possible to have a way to configure the underlying  
type  
which methods it needs to redefine with a new operator  
public class SomeClass{  
public void MyMethod(){  
}  
}

public class Inheritor : SomeClass {  
public new void MyMethod(){  
//some new logic here  
}  
}

something like

class Inheritor \< SomeClass

redef\_method :my\_method

end

---

<div class="post-metadata">

**Author:** ![barby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c57346/32.png) [@barby](https://www.ruby-forum.com/u/barby)\
**Post date:** [May 14, 2009, 10:49pm UTC](https://www.ruby-forum.com/t/aaah-yes-clr-interop/168003/2 "2009-05-14T22:49:16Z")

</div>

ok… makes sense. I’ll add it to the distant future features list :)And  
if  
it doesn’t actually really invoke the method on the Inheritor then the  
redefine\_method probably doesn’t make much sense to implement.

On Thu, May 14, 2009 at 10:31 PM, Curt H.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> I’m sorry I’ll probably keep hitting all those points while I’m writing
> 
> ```
> public new void MyMethod(){
> 
> ```
> 
> end  
> Blog: [http://flanders.co.nz](http://flanders.co.nz)  
> Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
> Author of IronRuby in Action ([http://manning.com/carrero](http://manning.com/carrero))
> 
> * * *
> 
> Ironruby-core mailing list  
> removed\_email\_address@domain.invalid  
> [http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)

## –

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
GSM: +32.486.787.582  
Blog: [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([http://manning.com/carrero](http://manning.com/carrero))

## Yogi Berra [http://www.brainyquote.com/quotes/authors/y/yogi\_berra.html](http://www.brainyquote.com/quotes/authors/y/yogi_berra.html)

“If you ask me anything I don’t know, I’m not going to answer.”

---

<div class="post-metadata">

**Author:** ![barby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c57346/32.png) [@barby](https://www.ruby-forum.com/u/barby)\
**Post date:** [May 14, 2009, 10:36pm UTC](https://www.ruby-forum.com/t/aaah-yes-clr-interop/168003/3 "2009-05-14T22:36:57Z")

</div>

In principle, this is absolutely something that could be done (though I  
wouldnâ€™t expect we would do it any time soon).

_but_, this doesnâ€™t do what I think you want. Previously-compiled calls  
to SomeClass.MyMethod wonâ€™t actually end up going to Inheritor.MyMethod  
even if the object is of type Inheritor. The base method would have to  
be defined as â€œvirtualâ€, or the new method will end up in a new slot on  
the method table.

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ivan Porto  
Carrero  
Sent: Thursday, May 14, 2009 12:23 PM  
To: ironruby-core  
Subject: [Ironruby-core] aaah yes … clr interop

I’m sorry I’ll probably keep hitting all those points while I’m writing  
integration specs.

Ok so would it be possible to have a way to configure the underlying  
type which methods it needs to redefine with a new operator

public class SomeClass{  
public void MyMethod(){  
}  
}

public class Inheritor : SomeClass {  
public new void MyMethod(){  
//some new logic here  
}  
}

something like

class Inheritor \< SomeClass

redef\_method :my\_method

end

## –

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Blog: [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([http://manning.com/carrero](http://manning.com/carrero))
