How do I convert Symbol to String, Integer to Float, and other similar type conversions in Clojure?
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.
You tell the compiler what type you want something to be by adding metadata to it.
This can make some operations faster and help eliminate reflection. The
^symbol is syntactic sugar for add this to the metadata for whatever comes next.Symbol to string:
For numbers, use the name of the type as a function name:
For more info: http://clojure.org/java_interop#toc35