This is a little note about a function I find myself using frequently in Clojure.
User interface code often needs to display a list of things as a comma-separated list, e.g. “a, b, c, d”.
If all of the things are strings, you can use the built-in string/join function to build such a string. When you have a sequence of things that are not strings, I suppose you could convert each element to a string and then use string/join. Or you could build your own. I like the function presented below, convert-seq-to-comma-separated-string. (Ok, the name needs some work.)
Here’s an example of usage.
"Return a string containing the members of the sequence separated by commas."