//C++ puts capture here:
auto f = [y](x: float) -> float { return x * x + y; };

//in our language let's put capture before the code block.
f := (x: float) ->float [y] {return x* x +y; };