<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
why not just make binary_to_term/2 be different function with /1. it will never need any other options someone ovously premature generalize iand make it take options instead of just making another function called binary_to_term_safe/1. anyways, i would like if you rename it to dudebro so i dont change my code<br><br>dudebro is one word. eitherways i dont think you understood me, i want to call the function as dudebro, not some function in my code<br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Wed, 13 Jun 2012 14:25:28 +0100<br>From: robert.virding@erlang-solutions.com<br>To: raymon.cb@hotmail.com<br>CC: erlang-bugs@erlang.org<br>Subject: Re: [erlang-bugs] term_to_binary/2 raises exceptions<br><br><style><!--
.ExternalClass p
{;}
--></style><div style="font-family:Times New Roman;font-size:12pt;color:#000000">It it binary_to_term/2 which takes 'safe' as an option. It should definitely *NOT* return {ok,Term} | {error,badarg} when the 'safe' option is used; it should always have the same structure for return values irrespective of options. So it either returns a term or signals a value.<br><br>dude_bro would be a better name than dudebro, separating words with '_' in atoms is a common convention. It would be a quick fix for you in your code.<br><br>Robert<br><br><hr id="ecxzwchr"><blockquote style="margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt">

<style><!--
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

--></style>
<div dir="ltr">


<a name="term_to_binary-2" target="_blank"><span class="ecxbold_code"></span></a><a href="http://www.erlang.org/doc/man/erlang.html#term_to_binary-2" target="_blank">term_to_binary/2</a>
 with [safe] as the second argument either throws an exception, or 
returns the decoded term. wouldnt it be better if it return either 
{error, badarg} or {ok, the decoded term} ? i think it should be changed
 to this. btw while at it can you rename the function to dudebro? ive 
already written my code and it uses that name everywher. thanks                                           </div>
<br>_______________________________________________<br>erlang-bugs mailing list<br>erlang-bugs@erlang.org<br>http://erlang.org/mailman/listinfo/erlang-bugs<br></blockquote><br></div></div>                                        </div></body>
</html>