As far as extension methods go - and just extension methods - we may at some 
point in time support them.  We won't ever support Ruby's mutation of 
everything under the sun including built-in types simply because that's not 
something CPython supports.

The tricky part w/ the extension methods is doing it in a way which is 
per-module instead of at a global scope.  In Ruby so much code mutates object 
that it's not really a big deal to add in some more mutation of types across 
the system.  But w/ Python these sort of changes have always been more closely 
scoped - for example look at from __future__ import ... which effects only the 
current module.  Another example is our own "import clr" which makes .NET 
attributes available on the built-in types.

I suspect what we'll end up doing is something like:

clr.LoadClrExtensions(namespace)

So it'd end up looking like:

import System
Import clr
clr.AddReference(System.Linq)


I do want to do something to continue to push LINQ forward for 2.7 and maybe 
this will be it if I can get it in...  Tomas added the metadata reader which we 
can use to efficiently get the extension methods and I think I might have an 
idea on how to efficiently share the extension methods across modules.

So I guess the question now would be does that look like a reasonable way to 
load extension methods?


From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of mlkjih mlkjih
Sent: Monday, August 09, 2010 9:10 AM
To: users@lists.ironpython.com
Subject: [IronPython] Similarity with builtin types

http://ironpython.net/documentation/dotnet/dotnet.html#similarity-with-builtin-types
What's the point? Is there any plans to support extension methods, something 
like IronRuby's using_clr_extensions? With immutable types it cannot be done, 
am I right?
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to