You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Sway, developers can create a mutable reference to a variable using something like the following
snippet:
letmutx=1;
lety=&mutx;
*y=1
As expected this updates the value of x. However, a mutable reference is not really usable in case of an
array due to limitations in the parsing. In particular, the parser prohibts the use of parentheses on the
left-hand-side of an assignment. The following snippet does not compile:
letmuta= [1, 2];
letmutp=&muta;
(*p)[1] =1;
The text was updated successfully, but these errors were encountered:
Implements dereferencing as LHS in reassignments for projections.
With this PR we will support:
- `(*array)[0] = 1`
- `(*tuple).0 = 1`
- `(*struct).a = 1`
This allow includes support for nested references.
Fixes#6397
Implements dereferencing as LHS in reassignments for projections.
With this PR we will support:
- `(*array)[0] = 1`
- `(*tuple).0 = 1`
- `(*struct).a = 1`
This allow includes support for nested references.
Fixes#6397
Implements dereferencing as LHS in reassignments for projections.
With this PR we will support:
- `(*array)[0] = 1`
- `(*tuple).0 = 1`
- `(*struct).a = 1`
This allow includes support for nested references.
Fixes#6397
Implements dereferencing as LHS in reassignments for projections.
With this PR we will support:
- `(*array)[0] = 1`
- `(*tuple).0 = 1`
- `(*struct).a = 1`
This allow includes support for nested references.
Fixes#6397
In Sway, developers can create a mutable reference to a variable using something like the following
snippet:
As expected this updates the value of x. However, a mutable reference is not really usable in case of an
array due to limitations in the parsing. In particular, the parser prohibts the use of parentheses on the
left-hand-side of an assignment. The following snippet does not compile:
The text was updated successfully, but these errors were encountered: