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
It is often useful to have a "replace" operation, where we replace B with A, and flow the old value of B to C. That is, the following situation:
B --> C
A --> B
Here are some possible syntax choices for this operation:
"Flow ordering" version. Pros: Easy-to-implement syntactic sugar; extensible to more than 2 flows ("multi-replace"). Cons: Looks strange, not clear what it does.
A -->2 B -->1 C
"Natural language" version. Pros: Can be read out loud; Cons: doesn't look like anything else in the language
replace B with A and flow to C
Use parentheses to suggest order. Looks more normal, has all the other benefits of the "flow ordering", but is a little "subtle", and may be unclear there is a difference between this and the unparenthesized version.
A --> (B --> C)
Alternatively, maybe writing two lines of code isn't that bad a thing... Or, for the specific case of consume, we can have an overwrite
The text was updated successfully, but these errors were encountered:
It is often useful to have a "replace" operation, where we replace
B
withA
, and flow the old value ofB
toC
. That is, the following situation:Here are some possible syntax choices for this operation:
Alternatively, maybe writing two lines of code isn't that bad a thing... Or, for the specific case of consume, we can have an
overwrite
The text was updated successfully, but these errors were encountered: