Skip to content

take and borrow parameter ownership modifiers #1739

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

Merged
merged 8 commits into from
Oct 25, 2022

Conversation

jckarter
Copy link
Contributor

No description provided.

@jckarter jckarter force-pushed the parameter-ownership-modifiers branch from ad8c1bc to ab25cbd Compare August 11, 2022 01:33
@jckarter jckarter force-pushed the parameter-ownership-modifiers branch from fdad5e7 to 7dd890e Compare August 26, 2022 20:19
- Use `taking` and `borrowing func` modifiers to control `self`'s convention
- Add "alternative considered" for whether `take`n parameters should be bound
  as mutable in the callee
@jckarter jckarter force-pushed the parameter-ownership-modifiers branch from 7dd890e to a80c5f2 Compare August 26, 2022 20:20
- Mention that nonescaping closure arguments cannot be `take`-n
- Mention "out" parameter conventions as a future direction
- Include discussion of destructuring move-only values that normally would have destructors,
  without invoking the normal deinit
@jckarter jckarter marked this pull request as ready for review September 14, 2022 23:55

taking func giveUp() -> Int32 {
// `deinit fd` is strawman syntax for consuming a value without running
// its initializer. it is only allowed inside of `taking func` methods
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the above be "its deinitializer"?

jckarter and others added 4 commits September 15, 2022 15:25
This fits better thematically as a future direction discussion with the `take` operator
proposal instead.
@airspeedswift airspeedswift merged commit 925341d into swiftlang:main Oct 25, 2022
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.

3 participants