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

Replace be with become #601

Merged
merged 2 commits into from
Feb 10, 2015
Merged

Replace be with become #601

merged 2 commits into from
Feb 10, 2015

Conversation

ranma42
Copy link
Contributor

@ranma42 ranma42 commented Jan 20, 2015

@ranma42
Copy link
Contributor Author

ranma42 commented Jan 20, 2015

Related to my original question here: #271 (comment)

@bstrie
Copy link
Contributor

bstrie commented Jan 20, 2015

+1 to this. Everyone that I've asked about this has preferred become to be, sometimes enormously so. Let's also remember that be was originally chosen by Graydon back when Rust guidelines kept keywords at five characters or less (return was ret in those days).

In terms of keywords to reserve, it also seems more likely that a user would accidentally attempt to use be as a variable name than become.

The remaining objection that I can foresee is whether we want to reserve a keyword at all for this purpose. Given that the TCE proposal has been merely postponed rather than rejected, I am free to conclude that others find this eventual feature as valuable as I do. If we ever ultimately decide against it, we can simply unreserve the keyword.

@steveklabnik
Copy link
Member

I like become as well, but I'd be in favor of just reserving both for now, and then we can deal with the question of what to use when the design for TCO actually happens.

@ranma42
Copy link
Contributor Author

ranma42 commented Jan 20, 2015

@steveklabnik should I add that to the alternatives section?

@steveklabnik
Copy link
Member

Sure :)

As suggested by Steve Klabnik, we can also have both `be` and `become`
as reserved keywords.
@nikomatsakis
Copy link
Contributor

I'm mildly amused by the idea of bikeshedding a reserved word for a non-existent feature, though I think I agree with your suggestion (particularly now that we long ago changed from ret to return). Still, maybe we should just remove both from our list of reserved words, since our general policy has been to assume we will find some way to opt-in for new keywords in the future.

@nikomatsakis
Copy link
Contributor

I guess @bstrie already commented on my point. I can kind of go either way in any case (that is, leave something reserved, or leave nothing reserved). Reserving both feels a bit like overkill. In general we've been moving away from reserving keywords, but this does fall under the category of "clear and desired purpose".

@Valloric
Copy link

Reserving become seems like the way to go. If the TCE feature that was proposed ends up being implemented, we would want to have that keyword at least available for consideration. Even in the (remote) case that we pick be then, become can then easily be removed from the keyword list.

So IMO reserving become is not bikeshedding the name as much as delaying the bikeshed (and, sigh, making it possible).

@nikomatsakis
Copy link
Contributor

@Valloric to be clear, no decision that we make here in any way "forecloses" the option of one keyword or the other. Our general position has been that we will not reserve every keyword we think we might want, but rather just adopt a mechanism for adding new keywords backwards compatibly in the future. That said, there are a number of reserved words that were "grandfathered" in---and in some cases, it seems to make sense to keep the word reserved, since we're pretty sure we're going to want it. This might be an example of the latter case.

@ranma42
Copy link
Contributor Author

ranma42 commented Jan 30, 2015

@nikomatsakis I prepared a branch which implements the replacement to evaluate the extent of the change (at least in rust-lang/rust; servo/servo should be fine, as it does not use become except in comments; other projects might break). This branch might also be a convenient reference to find out what needs to be done to have both be and become as reserved keywords. If the RFC is accepted, I will update as needed and do the PR.

@nikomatsakis
Copy link
Contributor

@ranma42 if you've done the work to implement it, I'd be inclined to accept this RFC and that PR.

ranma42 added a commit to ranma42/rust that referenced this pull request Feb 4, 2015
As per rust-lang/rfcs#601, replace `be` with `become` as reserved
keyword for tail call optimization.
@ranma42
Copy link
Contributor Author

ranma42 commented Feb 4, 2015

@nikomatsakis I fixed the conflicts and rebased it: rust-lang/rust#21918. I will file separate pull requests for the editor syntax files.

@oli-obk oli-obk mentioned this pull request Feb 4, 2015
@ranma42
Copy link
Contributor Author

ranma42 commented Feb 9, 2015

@nikomatsakis ping?

@nikomatsakis
Copy link
Contributor

We've decided to accept this RFC. Tracking issue is rust-lang/rust#22141.

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 10, 2015
As per rust-lang/rfcs#601, replace `be` with `become` as reserved
keyword for tail call optimization.
@ranma42 ranma42 deleted the be2become branch March 23, 2015 15:14
@Centril Centril added A-syntax Syntax related proposals & ideas A-expressions Term language related proposals & ideas A-keyword Proposals relating to keywords. A-tail-recursion Proposals relating to tail recursion. labels Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-expressions Term language related proposals & ideas A-keyword Proposals relating to keywords. A-syntax Syntax related proposals & ideas A-tail-recursion Proposals relating to tail recursion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants