You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I get around making {captor} work decently we can capture some side effects.
Some side effects should just make the function fail, warning that some side effects are not compatible with {refactor}, such as deleting files for example.
Some side effects could in principle be captured and silenced in original code, and captured but not silenced in refactored code. This includes printed output, messages, warnings, errors... It might be tricky though, if capture.output() is used for example it should capture something even if the output was silenced.
Maybe for the above example we can silence, capture and compare with, a combination of try, capture.output, and options(warn = 1)(so we can capture warnings with capture.output too). And then rethrow what was captured. Or we design our own capture.output variant that captures AND prints to console (if relevant), which we use on refactored code.
It might be that every compromise comes with corner cases though... so maybe these could be mitigated with options to opt in/out.
The text was updated successfully, but these errors were encountered:
If I get around making {captor} work decently we can capture some side effects.
Some side effects should just make the function fail, warning that some side effects are not compatible with {refactor}, such as deleting files for example.
Some side effects could in principle be captured and silenced in original code, and captured but not silenced in refactored code. This includes printed output, messages, warnings, errors... It might be tricky though, if capture.output() is used for example it should capture something even if the output was silenced.
Maybe for the above example we can silence, capture and compare with, a combination of try, capture.output, and
options(warn = 1)
(so we can capture warnings with capture.output too). And then rethrow what was captured. Or we design our own capture.output variant that captures AND prints to console (if relevant), which we use on refactored code.It might be that every compromise comes with corner cases though... so maybe these could be mitigated with options to opt in/out.
The text was updated successfully, but these errors were encountered: