Created
August 13, 2010 21:36
-
-
Save jurrchen/523581 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace clojure.lang | |
{ | |
public class GenGeneric | |
{ | |
public static object Create(Type genclass,PersistentVector gentypes,PersistentVector argv) | |
{ | |
Type[] cleantypes = new Type[gentypes.Count]; | |
gentypes.CopyTo(cleantypes,0); | |
if (argv.Count > 0) | |
{ | |
object[] cleanargv = new object[argv.Count]; | |
argv.CopyTo(cleanargv, 0); | |
return Activator.CreateInstance(genclass.MakeGenericType(cleantypes), cleanargv); | |
} | |
else | |
{ | |
return Activator.CreateInstance(genclass.MakeGenericType(cleantypes)); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment