Line continuation


#1

Is there a way to continue a statement on the next line? For example, with the Builder pattern:

class Builder {
    auto x;
    auto y;
    auto z;
    def Builder() {
        this.x = 0;
        this.y = 1;
        this.z = 2;
    }
    def print() {
        print("Builder: ${this.x} ${this.y} ${this.z}");
    }
    def setX(int x) { this.x = x; return this; }
    def setY(int y) { this.y = y; return this; }
    def setZ(int z) { this.z = z; return this; }
};

// One-liners are fine:
Builder().setX(4).print();                  // Builder: 4 1 2
Builder().setY(4).print();                  // Builder: 0 4 2
Builder().setZ(4).print();                  // Builder: 0 1 4
Builder().setX(4).setY(5).setZ(6).print();  // Builder: 4 5 6

// But I want to be able to do:
Builder()
    .setX(3)
    .setY(2)
    .print();

// Maybe the C way:
Builder() \
    .setX(3) \
    .setY(2) \
    .print();

// Or the Python way:
(Builder()
    .setX(3)
    .setY(2)
    .print());

None of these seem to work.

I can work around it by giving the builder a name:

auto b = Builder();
b.setX(3);
b.setY(2);
b.print();  // Builder: 3 2 2

Although I feel like there might be situations where that wouldn’t work.

Is this supported at all?