Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why aren't clojure strings of type clojure.string?

Tags:

clojure

Just curious on why a string in Clojure isn't of type clojure.string, and instead is java.lang.String. It seems a bit odd that I need to require clojure.string to access the native Clojure string functions?

like image 797
mark Avatar asked Jun 22 '26 20:06

mark


1 Answers

Because java.lang.String is immutable and doesn't break interoperability with Java. The functions in clojure.string can be mostly considered as a convenience layer on top of already existing functionality in the JDK and/or clojure.core.

like image 55
ponzao Avatar answered Jun 26 '26 13:06

ponzao



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!