Bug : For builtin types, Ruby methods should get precedence over CLR methods

I added the comment below to
http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=1082. Pure
Ruby programs which use names like to_string, get_type, equals, etc will
run into the bug, and the chances of this happening are non-nil. I think
the bug is worth trying to fix for V1 mainly because the proposed fix we
discussed of requiring users to do something like “include clr” could
break a lot of IronRuby apps, and so its better to do the change sooner
rather than later.

OTOH, if the fix is too expensive, we could defer it for later as there
are other bugs which I think people are more likely to run into…

most recent at top (show oldest at
sbordehttp://www.codeplex.com/site/users/view/sborde wrote Mon at 3:09
This is an issue due to the dual goals of IronRuby of being both Ruby
and a CLR language. The snippet below prints “In FixnumMixin#try_parse”
with MRI, and “1” with IronRuby since Fixnum and System.Int32 are both
one and the same in IronRuby.

module FixnumMixin
def to_string
“In FixnumMixin#to_string”

class Fixnum
include FixnumMixin

puts 1.to_string

This bug could be fixed by changing the default lookup rules for Ruby
builtin types that are also CLR types (not defined in IronRuby.*.dll),
with some explicit action required (eg. requiring the user to open the
Ruby builtin type and do “include clr”) to indicate that the user wants
the CLR methods.


From: Shri B.
Sent: Monday, May 11, 2009 1:28 PM
To: Tomas M.
Subject: FYI - Opened

A couple of different apps run into this…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs