You can always use const_get for the 1% cases. IMO, having
non-capitalized namespaces and classes is already 1% case, since such
libraries violate .NET design guidelines.
Tomas
From: [email protected]
[mailto:[email protected]] On Behalf Of Charles
Strahan
Sent: Sunday, March 27, 2011 4:19 PM
To: [email protected]
Subject: Re: [Ironruby-core] IronRuby not loading DLL
I figured that it’s always nice to have options - especially if there
are conflicts. Capitalizing the first letter would probably work in 99%
of cases, but I could imagine there might be case where you have an xFoo
type and an XFoo type in the same namespace.
That’s probably being pedantic though - just capitalizing the first
letter sounds like a pragmatic solution to me.
-Charles
On Sat, Mar 26, 2011 at 10:01 PM, Tomas M.
<[email protected]mailto:[email protected]>
wrote:
What would such block usually do? Uppercase the first letter of a
lower-cased class/namespace? We could do that or some other mangling
automatically. Is there any value in customizing the mangling?
Being it automatic would help you to discover the constants since they
would appear in Module#constants.
Tomas
From:
[email protected]mailto:[email protected]
[mailto:[email protected]mailto:[email protected]]
On Behalf Of Charles S.
Sent: Saturday, March 26, 2011 10:00 AM
To: [email protected]mailto:[email protected]
Subject: Re: [Ironruby-core] IronRuby not loading DLL
Tomas, how would you feel about adding an optional block param to
require/load_assembly for overriding how .NET types are mapped to
constants? That might be prove beneficial in cases such as these.
-Charles
On Fri, Mar 25, 2011 at 5:37 PM, Tomas M.
<[email protected]mailto:[email protected]>
wrote:
You need to use const_get to access classes/namespaces whose names are
not compatible with Ruby naming conventions.
A module in Ruby must start with capital ASCII letter.
const_get(:mdMATCHUPOBJECTLib).const_get(:mdMUIncrementalClass).new
should work.
Tomas