I agree. I feels like this naming disconnect would not exist in this case if you would work with a record/struct. That is what you sacrefice with tuples.
let { value, weight } =
if values.empty() {
{ value: 0, weight: 1.0 }
} else {
{ value: values[0], weight: 1 / values.len() }
}
Using JS style object expansion, instead of tuple expansion.