<br><br><div class="gmail_quote">On Mon, Jan 21, 2013 at 9:00 PM, Steve Davis <span dir="ltr"><<a href="mailto:steven.charles.davis@gmail.com" target="_blank">steven.charles.davis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Dmitry,<br>
<br>
It "makes sense" only if the "binary_to_term" decode is done in erlang.<br>
<br></blockquote><div><br></div><div>No - your could do it in C or java or C++. remember it's an external formal.</div><div><br></div><div>It makes sense for an external program to examine the format - that way</div>
<div>we can "teach" C++ etc. to understand erlang terms.</div><div><br></div><div>Inside Erlang you only use pairs of functions term_to_binary and the inverse</div><div>binary_to_term</div><div><br></div><div>/Joe</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
br,<br>
/s<br>
<div class="HOEnZb"><div class="h5"><br>
On Jan 21, 2013, at 1:53 PM, Dmitry Kolesnikov <<a href="mailto:dmkolesnikov@gmail.com">dmkolesnikov@gmail.com</a>> wrote:<br>
<br>
> Hello,<br>
><br>
> This make sense to me!<br>
><br>
> term_to_binary/1 returns a binary data object which is the result of encoding Term according to the Erlang external term format. See <a href="http://erlang.org/doc/apps/erts/erl_ext_dist.html" target="_blank">http://erlang.org/doc/apps/erts/erl_ext_dist.html</a><br>
><br>
> Use list_to_binary or unicode:character_to_binary depends on your use-case.<br>
><br>
> - Dmitry<br>
><br>
> On Jan 21, 2013, at 9:38 PM, Steve Davis <<a href="mailto:steven.charles.davis@gmail.com">steven.charles.davis@gmail.com</a>> wrote:<br>
><br>
>> The following appears to encode lists of integers as strings (?!?):<br>
>><br>
>> Eshell V5.9.3 (abort with ^G)<br>
>> 1> term_to_binary([1,2,3,4]).<br>
>> <<131,107,0,4,1,2,3,4>><br>
>><br>
>> Is there a reason for this that I'm missing?<br>
>><br>
>> regs,<br>
>> /s<br>
>><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>
<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>
</div></div></blockquote></div><br>