Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Renamed clear to destroy. #231

Merged
merged 1 commit into from
May 30, 2012
Merged

Renamed clear to destroy. #231

merged 1 commit into from
May 30, 2012

Conversation

jmdavis
Copy link
Member

@jmdavis jmdavis commented May 30, 2012

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.

An alias for clear remains but is scheduled for deprecation.
@MartinNowak
Copy link
Member

How about a changelog entry?

@jmdavis
Copy link
Member Author

jmdavis commented May 30, 2012

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 added a commit that referenced this pull request May 30, 2012
Renamed clear to destroy.
@MartinNowak MartinNowak merged commit 37e4163 into dlang:master 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants