I want to use mXparser from clojure which has an Expression Java class with multiple constructors:
public Expression(PrimitiveElement...elements) { ... }
public Expression(String expressionString, PrimitiveElement...elements) { ... }
In Java I can create new instance with a String argument:
Expression e = new Expression("1+2");
I assume it is using the second constructor because the first argument is string and the second is optional.
Now I want to do the same in clojure:
(Expression. "1+2")
It fails with
java.lang.String cannot be cast to [Lorg.mariuszgromada.math.mxparser.PrimitiveElement;
Looks like it is trying to use the first constructor which is not what I want.
How can I create a new instance of this class in Clojure only with a string argument?