Renamed clear to destroy. #231

merged 1 commit into from May 30, 2012


None yet

4 participants

D Programming Language member

An alias for clear remains but is scheduled for deprecation.

As discussed in the newsgroup, we want to rename clear to something else which is less likely to conflict with other functions and thus cause problems. destroy was a popular choice, so that's what I picked.

I also added a ddoc comment to destroy which I hope is clear enough, but clear has been undocumented, which it really shouldn't be, especially when we still unfortunately have delete documented.

jmdavis Renamed clear to destroy.
An alias for clear remains but is scheduled for deprecation.
D Programming Language member

How about a changelog entry?

D Programming Language member

I never mess with the changelog in pull requests, because it screws up merging far too easily. Assuming that this gets merged, I'll update the changelog then.

@MartinNowak MartinNowak merged commit 37e4163 into dlang:master May 30, 2012
@klickverbot klickverbot commented on the diff May 30, 2012
@@ -2243,7 +2243,17 @@ unittest
assert(a == b);
-void clear(T)(T obj) if (is(T == class))
+// Scheduled for deprecation in December 2012.
klickverbot May 30, 2012

Does having DDoc on aliases work? If so, this could probably be made a doc comment.

alexrp May 30, 2012

They don't; we have the same problem whenever we want to deprecate equals_t.

jmdavis May 30, 2012

Yes, they do work. For instance, DateTimeException is an alias for TimeException, and it shows up in the docs. I just didn't put ddoc on the alias, because clear wasn't actually documented in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment