Tomas Restrepo:

> The first one is related to RubySites. On the presentation, John shows
> how the shared DynamicSites in RubySites are used, for example, to ask
> if a given object/class supports a method and invoke it if it it does.
> The example in the presentation was to_int() for converting an object
> to an integer value, btw.
> What I didn't see John mention very explicitly is where/how those
> shared DynamicSites get initialized so that they point to the right
> places (maybe it's dumb question and I'm just not getting it still!).

Just looking over my slides again ... I'm guessing that your question relates 
to the RespondToSharedSite site that is called from RespondTo()? If so, the 
initial version of that site contains absolutely nothing but a call to 
UpdateSiteAndExecute(), which is the 'cry for help' method that Martin talks 
about in his blog: 
http://blogs.msdn.com/mmaly/archive/2008/01/22/building-a-dlr-language-dynamic-behaviors-3.aspx

So the first time through, the site will examine the method parameters, perform 
the dynamic lookup, and cache the result of that dynamic lookup in the site (in 
addition to invoking the target).

> - What exactly is the criteria for deciding whether a given class is a
> singleton or not? I see this is brought up throughout the code, but
> isn't very clear to me yet (and it might be a rubyism I'm not aware
> of).

Singleton classes in Ruby are classes that have exactly one instance. They are 
constructed on the fly from an instance. eg

b,c = Bob.new, Bob.new

class << b
  # mess with a class only for b
  def boo
  end
end
b.boo
c.boo # fails

> - What's the relationship between what goes around a RubyClass for a
> given type (in the case of .net objects) and the whole InstanceData
> business?

Not sure about this question ... can you clarify?

Thanks,
-John
_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to