Created
June 10, 2021 03:40
-
-
Save krlmlr/5ca4197116b83fb08fcc723b9cfe9a6b to your computer and use it in GitHub Desktop.
Block assigning to a variable more than once
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`<-` <- function(lhs, rhs, envir = parent.frame()) { | |
assign(as.character(substitute(lhs)), rhs, envir) | |
lockBinding(substitute(lhs), envir) | |
invisible(rhs) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment