rokitna
2019-7-14 13:31:01

In a situation like this, I often define a local function and call it on both sides of the if. That said, it arranges the control flow a little backwards compared to the define-values you have, so I wouldn’t say it’s an improvement necessarily.


sydney.lambda
2019-7-14 22:01:34

Thanks @rokitna I just seem to come up against this situation fairly often, so I’m worried it’s becoming a bad habit of my coding. Worryingly, it reminds me of the imperative style of having if statements which mutate the variables in different ways based on some conditions, before having a unified body that does something with them.