I recently saw a case where code like this:
x = f(z) + g(z) - h(z)
y = ...
was reformatted to:
x = f(z) + g(z)
- h(z)
y = ...
Of course, that silently changes the x
value computed, and the value of - h(z)
is just ignored. While rare, it's totally understandable how a change like this could be made accidentally. It makes me wonder if we should actually make this an error. Very few cases are affected; this can basically only happen with -
and +
, and it's hard to see why you would want to call those with one argument in void context.
I've defined +(::String)
to file an issue for the most recently loaded package, so adding a warning here would break my workflow.
I realize that's not a serious comment, but that wouldn't be in void context, so this change actually wouldn't break your workflow 馃榿
Actually it would be in a void context鈥攖he point of the joke was that this would only affect someone who has perversely defined a unwary +/- method with a side effect.
Most helpful comment
I've defined
+(::String)
to file an issue for the most recently loaded package, so adding a warning here would break my workflow.