Helper for live-editing of packages
Normally, objects in a NAMESPACEd package are locked and can't be changed. Sometimes this isn't what you want; you can prevent it by calling 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)
what |
(character) the names of the objects to not lock. |
pkgname |
(string) the name of the package. As you will only use this inside |
namespace. |
TRUE to antilock in the namespace during |
Locking occurs after .onLoad
/ .onAttach
are called so, to circumvent it, dont.lockBindings
creates a hook function to be called after the locking step.
lockBinding
, setHook
## Not run: 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 ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.