# IronRuby and Me

**URL:** <https://www.ruby-forum.com/t/ironruby-and-me/178766>\
**Category:** IronRuby\
**Created:** [November 11, 2009, 1:55am UTC](https://www.ruby-forum.com/t/ironruby-and-me/178766 "2009-11-11T01:55:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [November 11, 2009, 1:55am UTC](https://www.ruby-forum.com/t/ironruby-and-me/178766/1 "2009-11-11T01:55:39Z")

</div>

Hello again (sorry for the double post),

We’ve noticed some slightly odd behavior. IronRuby, it seems, won’t  
mangle methods that have the word “Me” in them, so if I have a method:

UncheckMeAndMyChildren, uncheck\_me\_and\_my\_children won’t work

but for:

UncheckSelfAndMyChildren, uncheck\_self\_and\_my\_children DOES work.

Is this a bug or the expected behavior?

Thanks,  
Martin

---

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [November 11, 2009, 2:26am UTC](https://www.ruby-forum.com/t/ironruby-and-me/178766/2 "2009-11-11T02:26:41Z")

</div>

Looks like a bug.

Tomas

---

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [November 11, 2009, 2:45am UTC](https://www.ruby-forum.com/t/ironruby-and-me/178766/3 "2009-11-11T02:45:25Z")

</div>

Martin,

Expected, but also a bug. IronRuby will not provide a mangled name if  
the method name contains a 2-letter-word that is not in this list:

as  
by  
do  
id  
it  
if  
in  
is  
go  
my  
of  
ok  
on  
to  
up

This list is pretty arbitrary … so “me” can probably be added to it.  
FYI, the code is in  
Merlin\Main\Languages\Ruby\Ruby\Runtime\RubyUtils.cs#TryMangleName  
(approx. line 298).

~Jimmy

---

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [November 11, 2009, 3:36am UTC](https://www.ruby-forum.com/t/ironruby-and-me/178766/4 "2009-11-11T03:36:22Z")

</div>

Thanks guys. Appreciate the (detailed) response.

Actually, this explains quite a bit. I’ve run into times sporadically  
where i’d be using the mangled name and it wouldn’t be recognized and  
had no ready explanation for it.

Is there a specific reason that two letter words arent mangled? (I  
was looking in the comments of RubyUtils.cs but didn’t find anything  
😛 ).

Thanks,  
Martin

On Tue, Nov 10, 2009 at 5:45 PM, Jimmy S.

---

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [November 11, 2009, 4:18am UTC](https://www.ruby-forum.com/t/ironruby-and-me/178766/5 "2009-11-11T04:18:30Z")

</div>

Gotcha… Thanks. I guess i’ve run into this myself with the  
occasionally mangled name some\_h\_t\_m\_l, but that makes perfect sense.

Thanks,  
Martin

On Tue, Nov 10, 2009 at 7:00 PM, Tomas M.

---

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [November 11, 2009, 4:25am UTC](https://www.ruby-forum.com/t/ironruby-and-me/178766/6 "2009-11-11T04:25:31Z")

</div>

FYI: The special cases are listed in unit tests  
(IronRuby.Tests\Runtime\RubyUtilsTests.cs). So you can look there if you  
are not sure if the behavior is intended or not.

Tomas

---

<div class="post-metadata">

**Author:** ![Martin\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@Martin\_Smith](https://www.ruby-forum.com/u/Martin_Smith)\
**Post date:** [November 11, 2009, 4:00am UTC](https://www.ruby-forum.com/t/ironruby-and-me/178766/7 "2009-11-11T04:00:56Z")

</div>

Yes, the reason is that .NET naming guidelines says that two-letter  
abbreviations are not camel-cased. That means we have names like  
GetIPAddress, PI, GetILGenerator etc. These are mangled to  
get\_ip\_address, pi, get\_il\_generator (not get\_i\_p\_address, p\_i, or  
get\_i\_l\_generator). Unmangling is inverse of mangling (name ==  
unmangle(mangle(name))), thus unmangling cannot turn “ip” into “Ip”.

Name-mangling is only heuristics. If some name doesn’t follow the  
guidelines or is ambiguous (let’s say “IT” in ITManager vs. “It” in  
ItJustWorks) then you need to use regular name.

Tomas
