r-lib / prettycode

Syntax highlight R code in the terminal
https://r-lib.github.io/prettycode/
Other
101 stars 9 forks source link

Should the environment be included in the print when it is NULL (i.e. for primitive functions) #11

Closed mdequeljoe closed 4 years ago

mdequeljoe commented 4 years ago

I notice that when primitive functions are printed via prettycode the NULL environment is included:

prettycode::prettycode()
min
#> .Primitive("min")
#> NULL

from:

https://github.com/r-lib/prettycode/blob/33c541f7f4256fde95a1f28800baff433b898430/R/print.R#L78

gaborcsardi commented 4 years ago

Yeah, it is not really informative, so we might as well leave it out. I don't think it is possible for a non-primitive function to have a NULL environment.

Do you want to submit a PR?

mdequeljoe commented 4 years ago

sure will do