Clojure: creating new instance from String class name
There are two good ways to do this. Which is best depends on the specific circumstance. The first is reflection: (clojure.lang.Reflector/invokeConstructor (resolve (symbol “Integer”)) (to-array [“16”])) That’s like calling (new Integer “16”) …include any other ctor arguments you need in the to-array vector. This is easy, but slower at runtime than using new with sufficient … Read more