It can be useful
.
For reference this functionality already exists you can write return a, b:=a
For reference, no, it is not available. In v1, it evaluates the sub-expressions from left to right, before the function returns at that specific return statement, and returns the leftmost result. In v2,
(a, b:=a) is evaluated from left to right, but the expression returns the result from the rightmost sub-expression.
Cheers.
Edit, spoiler doesn't seem to work.
Spoiler-tag:
Simple function example, having similar effect,
Code: Select all
f 123
f(a){
b := defer( () => free(a) )
return msgbox('return line')
free(p){
msgbox p
}
}
defer(f){
return { base: { __delete : f } }
}