quoting
Bengt Kleberg
bengt.kleberg@REDACTED
Wed Nov 30 12:54:04 CET 2005
On 2005-11-29 17:26, Christian S wrote:
> This is mostly a me-too message. I too use binaries for strings often,
> and feel the lack of a 'binaries' module (like there is a 'string' and
> a 'lists' module that are useful for the usual way to do strings). I
> feel a jungerl lib idea growing.
>
> So this question goes out to all readers:
> What interfaces do you chose to use for your utility functions?
>
> Personally, I use something like this frequently:
>
> skip(<<"abc:def">>, $:) to get <<"def">>
>
> piks(<<"abc:def">>, $:) to get <<"abc">>
>
> divide(<<"abc:def">>, $:) to get {<<"abc">>, <<"def">>} (like joe's
> but only single-char divider)
>
> match(Bin, RE) -> regexp:match(binary_to_list(Bin), RE).
>
> part(<<"abcdef">>, 3, 2) -> <<"cd">>.
could the names be made more consistent with the existing erlang
libraries by using something like the names in lists module?
dropwhile/2, takewhile/2, sub<list>/3 (replace list with binary or set)
and from string module:
tokens/2
bengt, who thinks tokens is a misleading name, but realise that it would
be really difficult to change.
More information about the erlang-questions
mailing list