[eeps] Re: [erlang-questions] [eeps] EEP 35 "Binary string modules" (fwd)

Patrik Nyblom <>
Mon Nov 15 12:09:45 CET 2010


Hi,

I think this is a really good point. I didn't think along these lines as I 
was focused on making the original EEP more specific, not changing the 
actual intention of that EEP. Now that I read your comment, I 
actually think it would be a better idea to change the original intention 
of the EEP to a general string handling module...

As this module handles unicode, it's however not really io_lists we're 
talking about except in the latin1 case. For unicode data we have mixed 
datatypes that are not io_lists, but described as 'chardata()' in the top 
of the 'unicode' module manual page. I suppose that the general idea of 
handling this type of mixed data is what you're after.

A general string module could have much the same interface, but of course 
slightly changed to fit the more general datatypes involved.

There are several ways to go here. One way is to simply accept 
mixed character data as input, behaving as if an implicit 
'unicode:characters_to_binary()' was executed on the parameters, in which 
case return values etc would be retained as is. This would correspond to 
how the re module handles mixed data, but would invalidate the use of the 
module as a replacement when we actually want to work with lists.

A better aproach, I think, would be to return binaries if the input is 
binary, but deep character lists otherwise. In the case of latin1 data, 
they can be directly used as io_lists if so required.

What kind of aproach did you have in mind?

I'm definitely open tho the idea of rejecting this EEP and instead write 
one for this type of general string handling module.

What do others on the list think?

Cheers,
/Patrik

PS. Just a question; Which modules do you have in mind when you write that
some modules do not support Unicode when handling strings? The idea is
that string handling routines should handle unicode, while byte-oriented
modules do not specifically do this (when writing i.e. to a file, you
cannot write unicode characters without suppling a specific format. After
all, we write bytes to a file, not some abstract notion of characters). 
DS.

On Mon, 15 Nov 2010, Patrik Nyblom wrote:

> Forwarded from erlang-questions mailing list.
> ---------- Forwarded message ----------
> Date: Thu, 11 Nov 2010 19:27:56 +0100
> From: Zoltan Lajos Kis <>
> To: Erlang Users' List <>
> Subject: Re: [erlang-questions] [eeps] EEP 35 "Binary string modules"
>
> My opinion is that it would be more convenient to have a (single) module that 
> provides string handling on the iodata() data type.
>
> Right now we have some functionality available only for list strings, some 
> for binary strings, and some for iodata strings;
> some with unicode support, some without. This new module would definitely 
> broaden the available functionality, but it
> feels like we will still have to convert b/w iodata, lists and binaries.
>
> Regards,
> Zoltan.
>
>
> On 11/11/2010 4:31 PM, Kenneth Lundin wrote:
>> We have a quite new EEP (EEP 35) with the title "Binary string
>> module(s) that we want your feedback on so we can
>> start implement it.
>> 
>> We would like to get your feedback before November 25.
>> 
>> If you are attending the Erlang User Conference next week , take the
>> opportunity to discuss the EEP with your fellow Erlangers and
>> with us in the OTP team at Ericsson.
>> 
>> /Kenneth, Erlang/OTP Ericsson
>> 
>> 
>> ---------- Forwarded message ----------
>> From: Raimo Niskanen<>
>> Date: Mon, Oct 4, 2010 at 5:36 PM
>> Subject: [eeps] EEP 35
>> To: 
>> 
>> 
>> A new EEP
>>     EEP 35: Binary string module(s)
>> has been added. See
>>     http://demo.erlang.org/eeps/
>> andalso
>>     http://github.com/erlang/eep/tree/master//eeps/
>> 
>> --
>> 
>> / Raimo Niskanen, Erlang/OTP, Ericsson AB
>> 
>> ________________________________________________________________
>> eeps (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:
>> 
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:
>> 
>> 
>
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
> ________________________________________________________________
> eeps (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>


More information about the eeps mailing list