[erlang-questions] [eeps] EEP 9
Adam Lindberg
adam@REDACTED
Fri Mar 7 10:22:15 CET 2008
Please name the module 'bstring' in instead of 'string_as_binary'. :-)
Cheers!
Adam
On Fri, Mar 7, 2008 at 9:43 AM, Per Gustafsson <per.gustafsson@REDACTED>
wrote:
> Very good work, but I do have some comments:
>
> Just as for lists and strings I think that there should be two different
> modules one which just operates on binaries and one that operates on
> binaries which are really strings. This module seems to be first of
> these two for the most part so functions that only makes sense if the
> binaries are strings should probably reside in some other module. The
> string_as_binary module could have more or less exactly the same API as
> string and similar modules could be defined for utf8, utf16 and utf32 if
> necessary.
>
> * to_upper(Binary1) -> Binary2
> to_lower(Binary1) -> Binary2
>
> Should be in the string_as_binary module
>
>
> * binary_to_atom(Binary) -> Atom
> atom_to_binary(Atom) -> Binary
>
> As you write these should probably be in the erlang module along with
>
> binary_to_existing_atom(Binary) -> Atom
>
>
> * unsigned_to_bin(Integer)-> Binary
>
> What does this function do? Does it create the shortest possible binary
> in which the unsigned integer would fit?
>
> better names might be
>
> binary:from_unsigned(Integer) -> Binary
> binary:to_unsigned(Binary) -> Integer
>
> * nth(N, Bin) -> Value
>
> To also satisfy 0-indexers there should probably be a
>
> nth0(N, Bin) -> Value
>
> just as in the lists module
>
>
> Per
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080307/9f939ddf/attachment.htm>
More information about the erlang-questions
mailing list