Skip to content

Implement 'with' statement #84

@ramonasuncion

Description

@ramonasuncion
  • A new 'with' statement provides syntactic sugar for monadic control flow.
    Within a block, the subsequent statements after a 'with' statement are
    passed as a capture-by-value lambda to the function specified as the 'with'
    statement's operand.
    // 0.2
    foo(x) {
    with y = bar(x);
    with z = bas(y);
    qux(z);
    }

    // desugars to

    foo(x) {
    bar(y => {
    bas(z => {
    qux(z);
    }, y);
    }, x);
    }
    Thanks to Arvid Picciani.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions