// sum :: (nums: ..i32) -> i32 {
sum :: (nums: ..i32) -> total: i32 {
// total: i32 = 0;
for num in nums {
total += num;
}
return total;
}
Having available Named Return Values already defines the return value at the procedure definition so there is no need to retype nor instantiate it in the procedure body.
Consider the following code:
Having available Named Return Values already defines the return value at the procedure definition so there is no need to retype nor instantiate it in the procedure body.