Skip to content
Prev 22442 / 63424 Next

Error condition in evaluating a promise

"Roger D. Peng" <rdpeng at gmail.com> writes:
You can do that with active bindings.  Have the function look in an
environment for the data.  If found, return it.  If not, load it into
the env and then return it.

We are using this approach in the BSGenome package in BioC (look there
for an example if you want) and it provides behavior very similar to
lazy data, but more manageable in a number of ways.

+ seth