# NOT RUN {
mod <- function(x, b = 5) x %% b
mod.m <- memify(mod) ## or memify("mod")
mod.m(7) ## using default b = 5
mod.m(b = 3) ## using remembered x = 7
mod.m() ## the same as previous
arglist(mod.m) ## list of all memified arguments
update (mod.m, b = 9) ## silently updates arglist
arglist(mod.m)
arglist(mod.m) <- list(x=11) ## replaces the arglist with a new list
arglist(mod.m)
## b is no longer memified, so mod's default = 5 is used:
mod.m()
## cleanup
rm(mod.m)
# }
Run the code above in your browser using DataLab