> On 26 Jun 2016, at 18:03, Filip Haglund <[email protected]> wrote:
> 
> Could this be done automatically by the compiler? Replacing `String.length 
> str >= 13` with `String.at <http://string.at/>(str, 13) != nil`?

I don’t think this could be done as it has different semantics. 
String.length(binary) will fail if the string is not valid utf8, the proposed 
version won’t fail if the invalid sequence is past the searched index. This is 
similar to regular length/1 for lists with improper lists.

Michał.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CDA01494-EDC8-44BD-8FCA-36F1355D5919%40muskala.eu.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to