Discussing closure capture syntax

fn do(*args, +var, mut a, read z, mov x)

The plus stands for the additional arguments of the closure’s captures. The first modifier is applied to all unspecified captures. The plus also goes well with * and /.

  • mov: owned variable by move
  • var: owned variable by copy

Why mov and not move?
The “e” is silent and 3 characters are a good size. Is the “e” in “mutable” be written out? It would be silly if “mutable(7ch)” were shorter than “move(4ch)”.

What will this generate?

struct Do:
    fn __init__(mut a: A, var b: B, var c: C, var x: X, read z: Z) -> Self:
        self.a = Pointer(to=a)
        self.b = b # copy
        self.x = x^
        self.z = Pointer(to=z)
    fn __call__(var self, *args) ...
    fn __call__(ref self, *args) ...
Do(a, b, c, x^, z).__call__(*args)