[erlang-questions] Binary string literal syntax

Vlad Dumitrescu vladdu55@REDACTED
Wed Jun 6 14:00:20 CEST 2018


Hi!

I have a few thoughts about this. I would favor the proposed syntax, but
not if things don't get simpler. What I mean is that there's more to
consider.

- Some modules don't handle binary strings, but lists of chars; most
notably erl_scan. If the syntaxes are too close, it might be even more
confusing when to use which form.
- The new string functions work with strings as sequences of lexemes. The
"list strings" are lists of characters, so for example calling length() on
the two representations of the same text may not return the same value.
Most notably, CRLF is a lexeme, but two characters.
- When working with a textual protocol, it's still quite often that one
would use <<"prefix"/utf8, Rest/binary>>, where the current syntax still
has to be used. It might be confusing?
- The predefined type string() is  still [char()], and for binary strings
there is unicode:chardata(), which in not necessarily obvious (as these are
handled by the string module).

best regards,
Vlad


On Wed, Jun 6, 2018 at 1:37 PM Nathaniel Waisbrot <nathaniel@REDACTED>
wrote:

> Thanks for copying my email to the list, Sean. That's what happens when I
> stay up late writing emails.
>
>
> > - That UTF-8 has emerged as the universal standard for string data
>
>
> I think this is an important point. Your bin-string-marker proposal would
> actually be equivalent, I think, to <<"some string"/utf8>> which is a
> little more of a mouthful and therefore a better argument in favor of it.
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180606/2fbad5de/attachment.htm>


More information about the erlang-questions mailing list