<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Sat, Mar 5, 2016 at 4:04 AM Jesper Louis Andersen <<a href="mailto:jesper.louis.andersen@gmail.com">jesper.louis.andersen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">So to catch up:<div><br></div><div>* On Richard's comments of other uses than for a string:</div><div><br></div><div>The obvious use in Erlang is to produce iolist() types for binary data: intersperse($, [<<"a">>, <<"b">>, <<"c">>]) is relatively common in my code. The slightly less obvious use is to interleave a simplifier step in between every optimization step of a compiler, but I've only done that once in my life and I'm not sure it is that useful :)</div></div></blockquote><div><br></div><div>Yep, iolists is the application I have for this.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>* On the name choice of 'intersperse/intercalate':</div><div><br></div><div>I think the semantics I'm aiming for is so close to the OCaml(Core)/Haskell implementations I'm willing to reuse that name. Another valid name is 'join' which is common in many other languages. I don't think one is better than the other, but the FP roots in me says we should adopt FP-language naming.</div></div></blockquote><div><br></div><div>In looking over the naming conventions in Erlang, one might assume that the design pattern is for diversity rather than uniformity. That's a nice way to look at it I think.</div><div><br></div><div>Personally I'd vote to converge on some standards rather than diverge - and taking cues from Erlang, and not the many many other languages, will help there. The clear analog is string:join. It's also short - saves valuable typing cycles!</div><div><br></div></div></div>