Closed moodymudskipper closed 5 years ago
found this by accident :
crayon:::`$.crayon` function (crayon, style) { attr(crayon, "_styles") <- c(attr(crayon, "_styles"), data_env$my_styles[style]) crayon } library(crayon) cat(blue("hello")) cat(blue$bold("hello"))
$.crayon is a function operator / adverb, but instead of returning a modified rhs like tags it returns a modified lhs.
$.crayon
We don't have a blue function here, its is used as the index of data_env$my_styles to apply the relevant modifications.
blue
data_env$my_styles
archived
found this by accident :
$.crayon
is a function operator / adverb, but instead of returning a modified rhs like tags it returns a modified lhs.We don't have a
blue
function here, its is used as the index ofdata_env$my_styles
to apply the relevant modifications.