magic
magic copied to clipboard
define generic functions
(defn foo [^:T t]
(let [lst (new List (type-args T))]
(.Add lst t)
lst))
(foo 90) ;; => List<long>
should compile to something along the lines of
using System;
using System.Collections.Generic;
public class foo_function {
public List<T> invoke_magic<T>(T t) {
var lst = new List<T>();
lst.Add(t);
return lst;
}
public object invoke_clojureclr(object t)
{
return invoke_magic(t);
}
}