[Ironruby-core] Couple of Questions

Tomas Restrepo tomas at winterdom.com
Fri Feb 22 16:57:36 EST 2008

Hi everyone,

I was watching yesterday's John Lam's Lang.NET presentation on
IronRuby (Great presentation, btw, really enjoyed it), and it was
pretty informative (to me, at least). Besides that, I've been looking
at the IronRuby and DLR code trying to become more familiar with  how
everything fits together (haven't tried my hand yet at extending the
libraries because I'm honestly a ruby newbie) and had a couple of
questions. I hope they're not too stupid :)

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!).

The second question was not directly influenced by the presentation,
and it's basically if someone would care to explain a bit better how
Ruby obtains the corresponding RubyClass instance for an object. I
understand the basic mechanism at the code level, but some points I'm
not too sure about:

- 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
- What's the relationship between what goes around a RubyClass for a
given type (in the case of .net objects) and the whole InstanceData

Tomas Restrepo

More information about the Ironruby-core mailing list