[Ironruby-core] Handling C# lower case namespaces

Tomas Matousek Tomas.Matousek at microsoft.com
Fri Dec 5 16:50:09 EST 2008


Well, that's very unfortunate. They seems to break .NET guidelines for namespace naming. It's not compatible with Ruby language to have lowercased namespaces since they behave like modules. Module names must start with an upper case. We can add some API to overcome this, but it won't be pretty. Something like

clr.class_get :foo, :bar, :baz would return class for type foo.bar.baz.

For now you can use reflection API to get the type (and Ruby class for that type):
System::Type.get_type("foo.bar.baz").to_class

As for Int64... it prints #<System::Int64:0x000005e>, which is not particularly useful. It should probably call ToString. I'll file a bug.

Tomas

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Aaron Feng
Sent: Friday, December 05, 2008 1:07 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Handling C# lower case namespaces

It seems like the current version does not handle lower case namespaces when referencing a .NET DLL.  It thinks it is a method call whenever a constant starts with lower case.  It also doesn't handle non-alphabet characters such as _ (underscore).

I'm trying to call WCF service from IronRuby via the proxies file.  svcutil converts all namespaces in the proxies file to lower case.  Here's some info on it:

http://connect.microsoft.com/wcf/feedback/ViewFeedback.aspx?FeedbackID=298408

I also noticed that "puts" does not output the value of Int64.  However, it does if I use Console.WriteLine in my ruby program.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081205/c3114486/attachment-0001.html>


More information about the Ironruby-core mailing list