Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make working with unique values easier
`recover` expressions now have access to values defined outside of them. These values are exposed as `uni ref T`/`uni mut T` and come with the same requirements as `uni T` types, such as methods only being available of their input and output is sendable. Fields in turn are also available for `uni T` receivers or when typed as `uni T`, and are exposed the same way. The result is that it's easier to work with unique values, without the need for further complicating the type system. For example, you can now do this: import std::net::ip::IpAddress class Config { let @ip: uni IpAddress } fn example(config: ref Config) -> uni IpAddress { recover config.ip.clone } In general this should remove the need for using `uni T` as return types all over the place, while still allowing you to easily move values between processes. This fixes #528. Changelog: added
- Loading branch information
1 parent
f004de4
commit f8bd249
Showing
10 changed files
with
163 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,7 +130,6 @@ tokens: | |
- it is essential | ||
- it is | ||
- it seems that | ||
- it was | ||
- magnitude | ||
- methodology | ||
- minimize | ||
|
Oops, something went wrong.