hi,<div>   This behave makes me confused too.<br><br><div class="gmail_quote">On Mon, Oct 1, 2012 at 4:46 PM, Jesse Gumm <span dir="ltr"><<a href="mailto:gumm@sigma-star.com" target="_blank">gumm@sigma-star.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>Hi,</p>
<p>You just need to convert List to a binary first with list_to_binary.</p>
<p>The <<"something">> syntax is just a friendly way to make binary literals. But it does not perform automatic casting of lists.</p>
<p>Further, the extra << >> you're wrapping around "-" is unnecessary.</p>
<p>Example:</p>
<p>> L = "123456",<br>
> B = list_to_binary(L),<br>
> <<B/binary,"-">>.</p>
<p>Will yield:</p>
<p><<"123456-">></p>
<p>Hope that helps.</p>
<p>Take it easy,</p>
<p>-Jesse</p>
<p>--<br>
Jesse Gumm<br>
Owner, Sigma Star Systems<br>
<a href="tel:414.940.4866" value="+14149404866" target="_blank">414.940.4866</a> || <a href="http://sigma-star.com" target="_blank">sigma-star.com</a> || @jessegumm</p><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On Oct 1, 2012 3:11 AM, "Chris Cook" <<a href="mailto:cookchrisd@gmail.com" target="_blank">cookchrisd@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Morning list,<br>
<br>
I have,<br>
<br>
Erlang R15B01 (erts-5.9.1) [source] [async-threads:0] [hipe] [kernel-poll:false]<br>
<br>
Eshell V5.9.1  (abort with ^G)<br>
1> List = "89234789234jhk2hk234892789fauky324978".<br>
"89234789234jhk2hk234892789fauky324978"<br>
2> <<List, <<"-">>/binary>>.<br>
** exception error: bad argument<br>
<br>
But when I write it as this,<br>
<br>
3> <<"89234789234jhk2hk234892789fauky324978", <<"-">>/binary>>.<br>
<<"89234789234jhk2hk234892789fauky324978-">><br>
<br>
I get the result I expected to get from the above 1 & 2. Could someone<br>
please explain what is going wrong and why, because I'm very confused<br>
with it.<br>
<br>
Regards<br>
<br>
Chris Cook.<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>
</div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>