What if we instead had syntax to pluck out at once all the members we need to consume, wouldn't that solve the problem in a simple way, without having to complicate language rules with definitions of partially deconstructed values?
Sometimes I wish there was a way to pluck multiple properties of a value into a tuple value with a syntax something like
t.(.a, .b, .c.0)
for a tuple of type(A, B, A)
ort.c.(ca: .0, cb: .1)
for the tuple type with labels(ca: A, ca: B)
. Maybe something like that could be used to pluck out multiple inout bindings at once without an exclusivity violation, as long as the members are distinct in memory?do { // Future direction? inout (a, b, ca) = &t.(.a, .b, .c.a) }
See: Pitch: `borrow` and `inout` declaration keywords - #16 by pyrtsa