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 Hagenlocher <curth at
microsoft.com>wrote:
> 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:* ironruby-core-bounces at rubyforge.org [mailto:
> ironruby-core-bounces at rubyforge.org] *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 Carrero
> Blog: http://flanders.co.nz
> Twitter: http://twitter.com/casualjim
> Author of IronRuby in Action (http://manning.com/carrero)
>
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
>
--
---
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto Carrero
GSM: +32.486.787.582
Blog: http://flanders.co.nz
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)
Yogi Berra <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."
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20090514/d3ad9553/attachment.html>