Skip to content

Design: "Replace" flows #10

@ReedOei

Description

@ReedOei

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:

  1. "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
  1. "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
  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions