I have found another way that better suits what I'm trying to do (and
control).
In a nutshell, I just add the function to the builtins. Here is the code:
// some member function, etc.
delegate int DoDelegate();
private int DoFunc()
{
return 10;
}
//... in the IronPython initialization, after t
ython
> Subject: Re: [IronPython] Calling functions in IronPython that don't
> really exist
>
> Actually this doesn't exactly work. If I want the command to be able to
> return a value, I can't go with the constructor route:
>
> res = AddNumbers( 3, 5 );
>
>
Actually this doesn't exactly work. If I want the command to be able to
return a value, I can't go with the constructor route:
res = AddNumbers( 3, 5 );
you want res equal to "8", but really it is an instance of my AddNumbers
class. I don't want the script writers to be able to save this class
in
Ok, now I feel a little stupid. Thanks :)
I think it would be wise to drop the "params object[] args" and go with
just actually specifying the parameters to the constructor so I can take
advantage of type checking, etc. from Python.
In the constructor I'll have to save the instance of the class c
Reference('MyAssembly')
import AddNumbers
AddNumbers(3, 4)
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Jeff Slutter
> Sent: Thursday, December 04, 2008 1:14 PM
> To: Discussion of IronPython
> Subject: [IronPython]
You can just create the function name and do nothing with it. In Cpython i
would use meta classes but idk if they are in IronPython
On Thu, Dec 4, 2008 at 11:13 PM, Jeff Slutter <[EMAIL PROTECTED]>wrote:
> I'm writing an application that I want to provide runtime scripting via
> IronPython for. T
I'm writing an application that I want to provide runtime scripting via
IronPython for. This application loads "plug-ins" from assemblies to add
functionality.
Each plug-in is a class with, for the sake of simplicity, a "Do" function.
What I'm trying to figure out is that if I have a class like: