Last chance! 50% off unlimited learning
Sale ends in
dont.lockBindings
in the .onLoad
for the package. For user-visible objects (i.e. things that end up in the "package:blah" environment on the search path), you can achieve the same effect by calling dont.lockBindings
in the package's .onAttach
function, with namespace=FALSE
.dont.lockBindings( what, pkgname, namespace.=TRUE)
.onLoad
, you can just set this to pkgname
which is an argument of .onLoad
..onLoad
; FALSE to.onLoad
/ .onAttach
are called so, to circumvent it, dont.lockBindings
creates a hook function to be called after the locking step.lockBinding
, setHook
library( debug)
debug:::.onLoad # d.lB is called to make 'tracees' editable inside 'debug's namespace.
debug:::.onAttach # d.lB is called to make 'tracees' editable in the search path
# NB also that an active binding is used to ensure that the 'tracees' object in the search...
#... path is a "shadow of" or "pointer to" the one in 'debug's namespace; the two cannot get...
#... out-of-synch
Run the code above in your browser using DataLab