Async update #30

Merged
noClaps merged 3 commits from async-update into main 2026-07-12 15:59:13 -04:00
Owner
  • Add mutex keyword to replace ^ type suffix. This makes it clearer that a mutex cannot be mut, since only one of those keywords is allowed.
  • Remove unlock keyword and replace with lock scope. When you lock a value, you create a new scope lock value { }, inside which the value is mut. The value unlocks when exiting out of the scope, either naturally when the code inside the scope is done running, or by exiting from the scope early with return or throw (which will also exit out of the surrounding function, if any), or with break (optionally with a label if needed).
  • Make Futures scoped. Any Futures not awaited by the end of the scope will be discarded, just like any other variable.
  • Add fut keyword to declare a Future instead of the * sigil.
- Add `mutex` keyword to replace `^` type suffix. This makes it clearer that a mutex cannot be `mut`, since only one of those keywords is allowed. - Remove `unlock` keyword and replace with `lock` scope. When you lock a value, you create a new scope `lock value { }`, inside which the value is `mut`. The value unlocks when exiting out of the scope, either naturally when the code inside the scope is done running, or by exiting from the scope early with `return` or `throw` (which will also exit out of the surrounding function, if any), or with `break` (optionally with a label if needed). - Make Futures scoped. Any Futures not `await`ed by the end of the scope will be discarded, just like any other variable. - Add `fut` keyword to declare a Future instead of the `*` sigil.
Add mutex keyword, remove unlock and make lock scope
All checks were successful
/ deploy (push) Successful in 1m18s
7da451453c
Also allow `return`, `throw` and `break` to early exit out of a `lock`
scope and unlock the value.
Make Futures scoped
All checks were successful
/ deploy (push) Successful in 1m19s
24a8b490ca
Add fut keyword
All checks were successful
/ deploy (push) Successful in 1m19s
f1113e20d7
noClaps deleted branch async-update 2026-07-12 15:59:13 -04:00
noClaps referenced this pull request from a commit 2026-07-12 15:59:15 -04:00
Sign in to join this conversation.
No reviewers
No labels
stdlib
syntax
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nclang/design!30
No description provided.