| Thread overview | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 25, 2012 phobos breakage... why? | ||||
|---|---|---|---|---|
| ||||
I was just playing with the beta, and got this among the
sea of errors:
arsd/cgi.d(898): Error: function std.algorithm.indexOf!("a == b",ubyte[],string).indexOf is deprecated
Why was that taken out? If you ask me, the root cause of D's
perceived stability problem has little to do with bugs. It
is 95% phobos devs removing functionality at random. Why do we
keep doing this?
| ||||
July 25, 2012 Re: phobos breakage... why? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Wednesday, July 25, 2012 19:24:05 Adam D. Ruppe wrote:
> I was just playing with the beta, and got this among the sea of errors:
>
> arsd/cgi.d(898): Error: function std.algorithm.indexOf!("a ==
> b",ubyte[],string).indexOf is deprecated
>
>
> Why was that taken out? If you ask me, the root cause of D's
> perceived stability problem has little to do with bugs. It
> is 95% phobos devs removing functionality at random. Why do we
> keep doing this?
Andrei scheduled that for deprecation ages ago. It just wasn't actually deprecated when it was supposed to be. As the documentation says, the problem was that it was just too easily confused with std.string.indexOf which is subtlely different. countUntil is its replacement and has been around for quite some time. Just rename the function call, and it should work.
- Jonathan M Davis
| |||
July 25, 2012 Re: phobos breakage... why? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | Le 25/07/2012 19:24, Adam D. Ruppe a écrit :
> I was just playing with the beta, and got this among the
> sea of errors:
>
> arsd/cgi.d(898): Error: function std.algorithm.indexOf!("a ==
> b",ubyte[],string).indexOf is deprecated
>
>
> Why was that taken out? If you ask me, the root cause of D's
> perceived stability problem has little to do with bugs. It
> is 95% phobos devs removing functionality at random. Why do we
> keep doing this?
The perfect illustration of the versionning thread concerns.
Thank you for that.
| |||
July 25, 2012 Re: phobos breakage... why? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Wednesday, 25 July 2012 at 17:24:06 UTC, Adam D. Ruppe wrote:
> I was just playing with the beta, and got this among the
> sea of errors:
>
> arsd/cgi.d(898): Error: function std.algorithm.indexOf!("a == b",ubyte[],string).indexOf is deprecated
>
>
> Why was that taken out? If you ask me, the root cause of D's
> perceived stability problem has little to do with bugs. It
> is 95% phobos devs removing functionality at random. Why do we
> keep doing this?
One of my programs stopped working in 2.060. It is *really* annoying when I see the message 'X is deprecated'.
| |||
July 25, 2012 Re: phobos breakage... why? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to dnewbie | On 7/25/12 10:36 AM, dnewbie wrote:
> One of my programs stopped working in 2.060. It is *really* annoying
> when I see the message 'X is deprecated'.
It might be nicer if you could say:
deprecated("Use countUntil instead.") {...}
| |||
July 25, 2012 Re: phobos breakage... why? | ||||
|---|---|---|---|---|
| ||||
On 7/25/12, Jonathan M Davis <jmdavisProg@gmx.com> wrote:
> As the documentation says, the
> problem
> was that it was just too easily confused with std.string.indexOf which is
> subtlely different.
I've always wondered how it's different? Using countUntil on strings seems to work ok for me, or should I be using string.indexOf?
| ||||
July 25, 2012 Re: phobos breakage... why? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to dnewbie | dnewbie:
> One of my programs stopped working in 2.060. It is *really* annoying when I see the message 'X is deprecated'.
I have to maintain a good amount of D2 code now, and it's keeping around broken or badly designed stuff is far annoying.
Bye,
bearophile
| |||
July 25, 2012 Re: phobos breakage... why? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On 7/25/2012 10:24 AM, Adam D. Ruppe wrote: > Why was that taken out? If you ask me, the root cause of D's > perceived stability problem has little to do with bugs. It > is 95% phobos devs removing functionality at random. Why do we > keep doing this? For a relevant discussion: http://d.puremagic.com/issues/show_bug.cgi?id=6277 | |||
July 25, 2012 Re: phobos breakage... why? | ||||
|---|---|---|---|---|
| ||||
On Wednesday, July 25, 2012 20:14:06 Andrej Mitrovic wrote:
> On 7/25/12, Jonathan M Davis <jmdavisProg@gmx.com> wrote:
> > As the documentation says, the
> > problem
> > was that it was just too easily confused with std.string.indexOf which is
> > subtlely different.
>
> I've always wondered how it's different? Using countUntil on strings seems to work ok for me, or should I be using string.indexOf?
code units vs code points.
string.indexOf will give you the number of code units
std.algorithm.countUntil will give you the number of code points
All it takes is having imported std.algorithm and std.string, and you could be getting a function which is doing completely the wrong thing for your code. That's why it was changed.
- Jonathan M Davis
| ||||
July 25, 2012 Re: phobos breakage... why? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to David Gileadi | On Wednesday, July 25, 2012 10:55:53 David Gileadi wrote:
> On 7/25/12 10:36 AM, dnewbie wrote:
> > One of my programs stopped working in 2.060. It is *really* annoying when I see the message 'X is deprecated'.
>
> It might be nicer if you could say:
>
> deprecated("Use countUntil instead.") {...}
We want that feature. Daniel Murphy even partially implemented it, but he didn't finish it, so we don't have it yet. At this rate, by the time that we get it, Phobos won't be deprecating anything anymore.
- Jonathan M Davis
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply