[erlang-patches] [patch] binary to/from integer

Robert Virding robert.virding@REDACTED
Fri Jan 11 13:21:19 CET 2013


And if it's supposed to create a binary representation of the integer as in

<<I>>

then I really don't see the need.

Robert

----- Original Message -----
> From: "Robert Virding" <robert.virding@REDACTED>
> To: "Anthony Ramine" <n.oxyde@REDACTED>
> Cc: "erlang patches" <erlang-patches@REDACTED>
> Sent: Friday, 11 January, 2013 1:09:48 PM
> Subject: Re: [erlang-patches] [patch] binary to/from integer
> 
> I missed the beginning of this discussion but is it supposed to do
> 
> list_to_binary(integer_to_list(I))?
> 
> If so I fail to see a pressing need.
> 
> Robert
> 
> ----- Original Message -----
> > From: "Anthony Ramine" <n.oxyde@REDACTED>
> > To: "Bob Ippolito" <bob@REDACTED>
> > Cc: "erlang patches" <erlang-patches@REDACTED>
> > Sent: Friday, 11 January, 2013 11:42:45 AM
> > Subject: Re: [erlang-patches] [patch] binary to/from integer
> > 
> > I disagree. Making it the big endian encoding of that integer is
> > something
> > that is already covered by OTP (binary:encode_unsigned/1 and its
> > friends),
> > and as you say, it's a *encoding* operation, not a type conversion.
> > Naming
> > this new BIF "integer_to_binary" isn't more confusing than
> > "atom_to_binary".
> > 
> > --
> > Anthony Ramine
> > 
> > Le 10 janv. 2013 à 23:13, Bob Ippolito a écrit :
> > 
> > > The purpose of integer_to_binary still isn't totally obvious from
> > > the name or output type, maybe it's digits, maybe it's the big
> > > endian encoding of that integer (which is closer to the behavior
> > > of binary_to_term / term_to_binary). For the more seasoned Erlang
> > > developer, I think they would expect it to behave like
> > > integer_to_string, but what about newer users?
> > 
> > _______________________________________________
> > erlang-patches mailing list
> > erlang-patches@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-patches
> > 
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@REDACTED
> http://erlang.org/mailman/listinfo/erlang-patches
> 



More information about the erlang-patches mailing list