Manually setup existing reference objects-- rarely used explicitly.
setup.mcache( envir, fpath, refs)
environment or position on the search path.
directory where "obj*.rda" files live.
which objects to handle-- all names in the mcache
attribute of envir
, by default
Creates an active binding in envir
for each element in refs
. The active binding for an object myobj
will be a function which keeps the real data in its own environment, reading and writing it as required. Writing a new value will give attr( envir, "mcache")[ "myobj"]
a negative sign. This signals that the "obj*.rda" file needs updating, and the next Save
(or move
or cd
) command will do so. [The "*" is the absolute value of attr( envir, "mcache")[ "myobj"]
.] One wrinkle is that the "real data" is initially a promise
created by delayedAssign
, which will fetch the data from disk the first time it is needed.
mlazy
, makeActiveBinding
, delayedAssign