www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Bultins .reverse and .sort are likely going to be removed soon.

reply Stefan Koch <uplink.coder googlemail.com> writes:
Hi guys,

I just finished the PR to remove the builtin array properties 
.sort and .reverse.

while the dmd changes were trivial fixing all the broken tests 
were not.
Even tests that were supposed to call std.algorithm.sort turned 
out to use the property by accident; (because of a small error 
which caused the sort template not to instantiate).

If you do have code which still relays on this, please update.

Cheers,
Stefan
May 24
parent reply Ivan Kazmenko <gassa mail.ru> writes:
On Wednesday, 24 May 2017 at 22:56:15 UTC, Stefan Koch wrote:
 I just finished the PR to remove the builtin array properties 
 .sort and .reverse.
That's nice! Finally, we could get rid of the awkward reverse() or sort!() in UFCS chains while all the rest don't need the parentheses.
 while the dmd changes were trivial fixing all the broken tests 
 were not.
 Even tests that were supposed to call std.algorithm.sort turned 
 out to use the property by accident; (because of a small error 
 which caused the sort template not to instantiate).
So, the process exposed latent bugs in the tests, which is another indication that the change is a Good Thing. I wonder how the deprecation message didn't make it happen sooner though. Ivan Kazmenko.
May 28
parent Stefan Koch <uplink.coder googlemail.com> writes:
On Sunday, 28 May 2017 at 09:23:01 UTC, Ivan Kazmenko wrote:
 On Wednesday, 24 May 2017 at 22:56:15 UTC, Stefan Koch wrote:
 I just finished the PR to remove the builtin array properties 
 .sort and .reverse.
That's nice! Finally, we could get rid of the awkward reverse() or sort!() in UFCS chains while all the rest don't need the parentheses.
 while the dmd changes were trivial fixing all the broken tests 
 were not.
 Even tests that were supposed to call std.algorithm.sort 
 turned out to use the property by accident; (because of a 
 small error which caused the sort template not to instantiate).
So, the process exposed latent bugs in the tests, which is another indication that the change is a Good Thing. I wonder how the deprecation message didn't make it happen sooner though. Ivan Kazmenko.
If the test is supposed to succseed we don't check the deprecation messages.
May 28