[IronPython] DLR and Iron* language types

Lee Culver leculver at microsoft.com
Tue Sep 25 19:32:50 CEST 2007


Both Ruby and Python have concepts of lists and dictionaries (though I think ruby calls them something different, and the details of how they are used are a bit different as well).  Is the DLR going to (eventually) support passing these objects between each other?

For example, let's say I have a piece of IronPython code as follows:

def foo(d):
    "d is a dictionary"
    if "bar" in d:
        del d["bar"]
    d["meaning of life"] = 42
    keys = d.keys()

    # call other dictionary functions on d here
    # ...
    # when this function returns, the Ruby hash object this
    # function was called with has been updated

Can I call into this function, from IronRuby, with the Ruby equivalent of a dictionary (I think that's a "hash" if I'm not mistaken) and have that hash updated as the "foo" method suggests?

I would imagine, from a programmer's perspective, that even though the Ruby hash class has different functions, it's basically the same thing as the Python dictionary.  When you call into one language with the other's "equivalent objects" does the other language see it as their own type.

My question is, do you plan on supporting this type of functionality in the DLR and the Iron* languages?  If so, is that support implemented "now" (meaning when IronRuby is released will it support it)?

Thanks,
-Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20070925/6243ac56/attachment.html>


More information about the Ironpython-users mailing list