[IronPython] DLR question

Dino Viehland dinov at exchange.microsoft.com
Thu Jun 26 17:01:46 PDT 2008


The short answer to this is yes.  But there's a longer answer too :)

First off, it's not like you're going to be able to do:

class MyPythonClass(object):
    def MyPythonFunc(self): pass
    def MyRubyFunc
    end

or anything like that.  There's also no plans to support subclassing because generally the type systems are just too different.  But you can monkey patch all you want.  So you could do:

class MyPythonClass(object): pass

then in Ruby:

MyPythonClass.someFunc = someProcOrBlockOrWhateverThoseRubyGuysDo

And you could get crazy with metaclasses or other such magic to make this more seamless.

The other part of the long answer is that this doesn't necessarily work today - I'm actually not sure whether it does or not today.  We're actually in the process of finalizing the interop protocol right now and when that's done and all the languages have adopted the new protocol we'll start testing this and ensuring we have good interop.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens
Sent: Thursday, June 26, 2008 3:44 PM
To: Discussion of IronPython
Subject: [IronPython] DLR question

I have a DLR question and was wondering if you guys knew.  We have a python scripting system for our application.  We would like to add iron python to it as well.  My question is can I define a ruby function and an iron python function in the same class?  That way they can write ruby functions and python functions and they can all be bound with the same local variables and class state etc.

Michael Stephens

Electrical Engineering Graduate Student
University of Wyoming
falcon at uwyo.edu<mailto:falcon at uwyo.edu> or 89iroc at gmail.com<mailto:89iroc at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20080626/37b482db/attachment-0001.htm>


More information about the Users mailing list