-
Notifications
You must be signed in to change notification settings - Fork 990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid repetitive calls to print() [default] inside print.data.table() #6089
Comments
What do we think of changing each call to We could also make a function wrapper that calls |
Not if the wrapper defined within the print.data.table = function(...) {
# ...
print_default = function(x) print(x, quote=quote, na.print=na.print, right=right)
# ...
if (...) {
print_default()
} else {
print_default()
}
# ...
} The third option is if we can refactor the code to avoid needing 4 call sites to begin with, e.g. data.table/R/print.data.table.R Lines 122 to 124 in 7268eff
Should we do Can we combine the |
Looking at it now, quite a bit of the code in data.table/R/print.data.table.R Lines 121 to 128 in 7268eff
and data.table/R/print.data.table.R Lines 136 to 143 in 7268eff
Would it be beneficial to factor out these two big chunks as a function in the
in the factored code? |
It seems reasonable to me to make the |
Originally posted by @MichaelChirico in #6087 (comment)
As illustrated in the linked PR, it's a pain to maintain since we have to remember to update 4 separate call sites to
print.default()
, all with the same signature. This should be unified.The text was updated successfully, but these errors were encountered: