[erlang-questions] binary_to_term

Claes Wikstrom klacke@REDACTED
Wed Jun 10 20:24:11 CEST 2009

Michael Radford wrote:
> Kostis Sagonas writes:
>> You are so kind.  I personally think it is terrible!

I agree with Kostis here,

>> The issue has been discussed before, both in meetings and in this 
>> mailing list, and my understanding is that there are actually 
>> applications out there which depend on this "feature" (i.e., 
>> binary_to_term/1 succeeding when there is a prefix of the binary which 
>> can be turned into some Erlang term).

Hmm, I have a real hard time believing that there indeed are
such applications. All apps that use binary_to_term in
some way or an other either use sockets with {packet, X}
or if they write terms to disk, make up their own frames.

So - IMHO - changing this will not break anything. What's
even more irritating here - is that this issue is probably
originally my fault :-(

> I personally don't see what's so terrible about this behavior.

All apps that store or receive binaries that are later to be
turned into terms MUST use some framing. Thus any apps that
break here are already broken - someway - since they're discarding

I know that this ain't no voting both - but regardless - I cast
my vote !! Like Obama, I vote for Change.


More information about the erlang-questions mailing list