Closed
Description
Currently, a capture clause is written:
fn@[move x, y; copy z](a: T) { ... }
I was thinking that maybe we should write it inline with the parameters, like so:
fn@(a: T; move x, y; copy z) { ... }
The reasons are (1) I find it easier to read but also (2) it integrates with the sugared closures better:
task::spawn {|move x, y; copy z|
...
}
In general, then, the parameter list for a closure would have three parts:
- the normal parameters
- the
move mode
captures - the
copy mode
captures