Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert deprecation of body #15379

Merged
merged 1 commit into from
Jul 6, 2023
Merged

revert deprecation of body #15379

merged 1 commit into from
Jul 6, 2023

Conversation

WalterBright
Copy link
Member

The code comment says it all:

"body was quite widely used"

And it doesn't actually hurt anything to leave it in.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#15379"

@Herringway
Copy link
Contributor

It hurts the planned ability to free the body keyword for use as a name.

It also hurts trust in the language. It's been two years since the first release with the deprecation. People (myself included) have already made all the necessary changes. What else will be undone? Can we trust any of the other DIPs to remain implemented? I do not like this uncertainty.

Copy link
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

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

as noted the whole point of removing body as a keyword is so that is can be used as a variable name, deprecation is the first step towards that and we shouldn't be undoing that.

@WalterBright
Copy link
Member Author

Using body as a regular identifier is already allowed. This reversion will not break that. body is a contextual keyword, not an actual keyword.

Can we trust any of the other DIPs to remain implemented?

We don't want to break those, either. The whole point of this initiative is to stop breaking peoples' existing code.

@ibuclaw
Copy link
Member

ibuclaw commented Jul 4, 2023

And it doesn't actually hurt anything to leave it in.

It hurts those who would like to have a variable named body?

For example, HTML content tends to have a body.

I see this was already mentioned.

body is a contextual keyword, not an actual keyword.

When did that happen? I only recall the many posts where users say they couldn't use body.

@WalterBright
Copy link
Member Author

@WalterBright WalterBright dismissed thewilsonator’s stale review July 4, 2023 08:35

body can already be used as a variable name

@adamdruppe
Copy link
Contributor

Yes, this is how it should have been done in the first place.

@WalterBright WalterBright merged commit 4af038d into dlang:master Jul 6, 2023
@WalterBright WalterBright deleted the body branch July 6, 2023 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants