How does JVM type erasure help Clojure? Can Clojure exist without it? What would happen if the JVM had reified types? That is, how would Clojure change?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Clojure wouldn’t change much at all. Type erasure only applies to Java’s type-parameters for generics. All other types are available at runtime.
Browsing Clojure’s source, it does not use generics much at all. In the runtime, it passes around
Objects and doesinstanceofchecks. By treating everything as anObject, it has no need for generics, and thus, there are no type-parameters to be erased.