[IronPython] Asymmetry in binary binding

2010-02-19 Thread Jeffrey Sax
Hi, I have the following C# code: public class MyObject : IDynamicMetaObjectProvider { int value; public MyObject(int value) { this.value = value; } static public int operator *(int left, MyObject right) { return left * right.value; } static public int operator *(MyObject left, i

Re: [IronPython] Magic methods on CLR types

2009-12-02 Thread Jeffrey Sax
pick up the List version later in resolution via a .NET mapping than looking up members by name. But you can define the integer overload for __getitem__ and forward it to the real implementation. We could also consider just adding slicing support for List to IronPython natively J We proba

Re: [IronPython] Magic methods on CLR types

2009-12-02 Thread Jeffrey Sax
IronPython] Magic methods on CLR types If you want IronPython to recognize them you just need to create an assembly w/ ExtensionTypeAttribute and have it point at the extended and extending types. Then the assembly needs to be loaded into the ScriptRuntime using ScriptRuntime.LoadAssembly. We still need to figur

Re: [IronPython] Magic methods on CLR types

2009-12-02 Thread Jeffrey Sax
ports. From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Jeffrey Sax Sent: Tuesday, December 01, 2009 5:27 PM To: 'Discussion of IronPython' Subject: [IronPython] Magic methods on CLR types Is there a way to add magic methods like __r

[IronPython] Magic methods on CLR types

2009-12-01 Thread Jeffrey Sax
type corresponding to the CLR type? If so, how? 3. If neither of these alternatives is possible, is there a third way? Thanks! Jeffrey Sax ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users

Re: [IronPython] sympy on IP 2.6B2

2009-07-26 Thread Jeffrey Sax
I got sympy 0.6.5 running *without* frames by commenting out some lines: sympy\__init__.py: line 44 # evalf._create_evalf_table() Sympy\utilities\__init__.py: lines 14 and 18: # from source import source # from runtests import test, doctest There are two more anomalies I'd like to report: 1. P

[IronPython] Operator resolution with implicit conversion

2009-07-26 Thread Jeffrey Sax
Given the following C# code: public class A { public static A operator+(A a1, A a2) { return null; } public static implicit operator A(int n) { return null; } } public class B : A {} In C#, I can then write: B b = new B(); A c = b + 1; However, in IronPython I get: >>> b = B() >>> c = b

Re: [IronPython] sympy on IP 2.6B2

2009-07-26 Thread Jeffrey Sax
Thanks Michael & Dino, That gets me a step further: >>> from sympy import Symbol Traceback (most recent call last): File "", line 1, in File "c:\Program Files (x86)\Python26\Lib\site-packages\sympy\__init__.py", line 44, in c:\Program Files (x86)\Python26\Lib\site-packages\sympy\__init__.py

[IronPython] sympy on IP 2.6B2

2009-07-24 Thread Jeffrey Sax
According to the archives, some version of sympy worked on IP 1.x at some point in the distant past. Now, with the latest version of both (sympy 0.6.5 on IronPython 2.6.B2), I get this: PS C:\Program Files (x86)\IronPython 2.6> .\ipy.exe IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4918 Type

[IronPython] DLR and VS-Interactive

2007-05-01 Thread Jeffrey Sax
nment. Is this where the refactoring is headed? Jeffrey Sax Extreme Optimization ___ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com