I would like to cast a clojure Java object (assigned with let*) to another Java class type. Is this possible and if so then how can I do this?
Update:
Since I posted this question I have realised that I do not need to cast in Clojure as it has no concept of an interface, and is more like Ruby duck typing. I only need to cast if I need to know that an object is definitely of a certain type, in which case I get a ClassCastException
There is a
castfunction to do that inclojure.core:By the way, you shouldn’t use
let*directly — it’s just an implementation detail behindlet(which is what should be used in user code).