IIRC you can open &quot;concrete&quot; generics, but not &quot;open&quot; ones: In plain english this means you can add methods to List&lt;string&gt; but not List&lt;T&gt;. <div><br></div><div>This is essentially because List&lt;T&gt; isn&#39;t a real type in the CLR, it&#39;s basically some metadata that can be used to build a real type when the T is supplied.</div>
<div><br></div><div>You could as an alternative add methods to the underlying non-generic IEnumerable interface, but then you&#39;d have to do some run-time reflection to figure out that your List is actually a List&lt;string&gt;... This is probably not nice.</div>
<div><br></div><div>In theory when CLR4 lands and has support for co/contra variant generics, List&lt;object&gt; should match List&lt;string&gt; and everything else, but I don&#39;t know if IronRuby would also work for this?</div>
<div><br></div><div>Good luck<br><br><div class="gmail_quote">On Tue, Feb 2, 2010 at 7:52 AM, Ryan Riley <span dir="ltr">&lt;<a href="mailto:ryan.riley@panesofglass.org">ryan.riley@panesofglass.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>I have been trying to figure out how to Rubify generic extension methods for use with the likes of Rx, Open XML SDK, etc. Ivan went over it a bit with me this weekend, but I&#39;m still having difficulty including a module within a .NET type. Is that even possible?</div>


<div><br></div><div>...</div><div><div><br></div><div>The questions I&#39;m not able to answer are:</div>

<div><ol><li>Can I somehow open up a .NET class, say System::Collections::Generic::List[T] and include the EnumerableExtensions? So far, I&#39;m finding that&#39;s a no.</li><li>How do I hook in the included(base) method above? I&#39;m assuming that&#39;s a one-time call, but I don&#39;t see anywhere that it&#39;s called when a module is included. Do I need to use a before_filter or perform that action at the beginning of the linq_select method?</li>


</ol><div><br></div><div>Thanks!</div></div></div><br clear="all">Ryan Riley<br><br>Email: <a href="mailto:ryan.riley@panesofglass.org" target="_blank">ryan.riley@panesofglass.org</a><br>LinkedIn: <a href="http://www.linkedin.com/in/ryanriley" target="_blank">http://www.linkedin.com/in/ryanriley</a><br>


Blog: <a href="http://wizardsofsmart.net/" target="_blank">http://wizardsofsmart.net/</a><br>Twitter: @panesofglass<br>Website: <a href="http://panesofglass.org/" target="_blank">http://panesofglass.org/</a><br>
<br>_______________________________________________<br>
Ironruby-core mailing list<br>
<a href="mailto:Ironruby-core@rubyforge.org">Ironruby-core@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/ironruby-core" target="_blank">http://rubyforge.org/mailman/listinfo/ironruby-core</a><br>
<br></blockquote></div><br></div>