[Ironruby-core] IronRuby and MarkLogic

N. F. lists at ruby-forum.com
Fri Nov 30 09:30:25 EST 2007

John Messerly wrote:
> If you're up for diving into IronRuby's method binding logic, the place 
> to put a breakpoint is in ironruby/runtime/RubyActionBinder.cs, 
> MakeRuleForInvokeMember, in particular the line:
>     RubyMethodBase method = ec.ResolveMethod(target, action.Name);
> At some point we'll hit that with action.Name == "NewSession". Then step 
> into ResolveMethod and see what happens. It should eventually get to 
> RubyClass.TryGetClrMember with name == "NewSession". But maybe it gets 
> lost somewhere along the way...
> - John

Thanks John...I took up the task and here is what I found out (the most 
important point is the last one - in uppercase - see below:

- calls
- target has only non-public members

- module is null, so it calls
RubyClass result = TryGetInstanceSingletonOf(obj, out data);

- calls
data = TryGetInstanceData(obj);
- obj (Marklogic.Xcc.Impl.ContentSourceImpl) is null inside of that

- calls
TryGetData(object key)

-eventually returns from TryGetInstanceData with result = null

- calls
GetClassOf(obj, data);

- inside RubyModule.cs (line 481):
// skip lookup on types that are not visible or interfaces:
if (_tracker != null && _tracker.Type.IsVisible && 
!_tracker.Type.IsInterface) {
  return TryGetClrMember(_tracker.Type, name, out method);
...this if returns false and it never calls TryGetClrMember!

- Nivaldo

Posted via http://www.ruby-forum.com/.

More information about the Ironruby-core mailing list