[IronPython] DLR question
dinov at exchange.microsoft.com
Fri Jun 27 02:01:46 CEST 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:
def MyPythonFunc(self): pass
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.
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...
More information about the Ironpython-users