Explicit capture clauses

14 points by emschwartz


osa1

IMHO capturing places (instead of values) looks strange, even more so with the "rewrite" syntax: move(a.b.c = a.b.c.clone()) || .... You can use a.b.c but a.b.d becomes an error.

I'd only allow capturing values, but then it becomes slightly shorter version of a bunch of let bindings before a move || .... I guess they want a more concise syntax than that?

My other comment would be that there's no end to adding shorthands for common patterns, at some point you have to stop or your language will be getting more and more complex with every release (with new syntax, rules, exceptions to the rules, ...). Personally I'm not sure that we need shorthands here. Just making captures explicit should be good enough IMHO.

(In the past I used a macro to make captures explicit, but I can't remember the name now. IIRC it was commonly used with the GTK bindings.)

isuffix

Niko slow down! Take a rest! It’s too many posts!