You are writing a comment about Writing Join in Erlang, here is a quick summary:
Erlang doesn't have a built in function for joining strings, and so I sat down to put one together quickly. A quick look at two different ways that join can be implemented.
You are responding to this comment written by Oliver on May 5th 2008, 09:44.
Not really... your post still has value in itself, illustrating two points: how to do a join yourself, and how hard it is to navigate the library documentation to find things.
The next step is to compare your implementation to the stdlib one:
join([H|T], Sep) ->
H ++ lists:concat([Sep ++ X || X <- T]).
That's more concise, but probably not as readable. And an elegant solution to the problem with the initial element.
In general this strikes me as very elegant, and makes clear to me that I myself am still too far stuck in the wrong paradigm. I would have implemented it more like you did.
Please be aware that comment forms go stale after one hour.
Comments may make use of LifeFlow MarkDown. Raw html will be escaped.
Quick Introduction to LifeFlow MarkDown Syntax
A highlighted code block:
Other common languages work as well: scheme, python, java, html, etc.
Other markdown syntax: