[erlang-questions] Changes to string module

Dan Gudmundsson <>
Fri Jul 21 16:17:47 CEST 2017


On Fri, Jul 21, 2017 at 4:02 PM Lloyd R. Prentice <>
wrote:

> Hi all,
>
> I can appreciate the reasons for the changes, but it has created moments
> of frustration for me.
>
> I'm running an earlier version of Erlang. Plan to upgrade, but not yet. My
> work habit is to frequently consult on-line Erlang docs.
>
> The other day I looked up string:span/2, which I've used in various places
> throughout my code. But what's this? It's marked "obsolete - use take/2."
>
> I must have caught the docs at a point of transition since there was no
> take/2 in the list of string functions. What to do? What to do?
>
> That version of the docs seems to have been updated. Both take/2 and
> span/2 are now in the list.
>
> OK, I can live with momentary and passing frustration. But now, when I
> upgrade Erlang, do I have to worry that span/2 will be dropped at some
> point--- after all, it's "obsolete."
>

It might be dropped at some point, but not in any near future, not until
OTP-23 and probably not in that release either.
We will deprecate (and add warnings) and remove the docs of the old
functions in OTP-21.

The old functions will be kept.


> Or do I have run two versions of Erlang?
>
> Plus, I now find the string docs much harder to use since I have to think
> about whether a given function is in my version of Erlang or not.
>
> Petty issues and, perhaps the price of progress. But it does illustrate
> that library revision may have unintended consequences.
>

The only difference right now (in OTP-20) is the addition of new functions
and the text that warns that the old ones will be deprecated in 21.
So the only problem you might get in OTP-21 is deprecated warnings for
using old functions which you can suppress.

/Dan


> Best wishes,
>
> LRP
>
> Sent from my iPad
>
> > On Jul 21, 2017, at 4:46 AM, zxq9 <> wrote:
> >
> > I missed it when looking through R20 release notes, but on referencing
> the string module I noticed a LOT of changes have happened there. String
> objects are now more or less based on unicode:chardata() and utf8 graphemes.
> >
> > Whoever is responsible for this -- THANK YOU.
> >
> > For those of us in East Asia life just got a bit easier. Not 100% easy,
> because what fun would that be, but this sure is a lot nicer.
> >
> > Yay!
> > -Craig
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://erlang.org/mailman/listinfo/erlang-questions
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170721/664f76b0/attachment.html>


More information about the erlang-questions mailing list