On 10/18/2006 1:17 PM, Roger D. Peng wrote:
> I've encountered a (I think) related problem when using promises to load
> relatively large datasets. For example something like
>
> delayedAssign("x", getBigDataset())
>
> runs into the same problem if you hit Ctrl-C while 'x' is being evaluated fo
"Roger D. Peng" <[EMAIL PROTECTED]> writes:
> I've encountered a (I think) related problem when using promises to load
> relatively large datasets. For example something like
>
> delayedAssign("x", getBigDataset())
>
> runs into the same problem if you hit Ctrl-C while 'x' is being evaluated for
On Wed, 18 Oct 2006, Simon Urbanek wrote:
>
> On Oct 18, 2006, at 1:17 PM, Roger D. Peng wrote:
>
>> I've encountered a (I think) related problem when using promises to
>> load relatively large datasets. For example something like
>>
>> delayedAssign("x", getBigDataset())
>>
>> runs into the same
On Oct 18, 2006, at 1:17 PM, Roger D. Peng wrote:
> I've encountered a (I think) related problem when using promises to
> load relatively large datasets. For example something like
>
> delayedAssign("x", getBigDataset())
>
> runs into the same problem if you hit Ctrl-C while 'x' is being
> e
I've encountered a (I think) related problem when using promises to load
relatively large datasets. For example something like
delayedAssign("x", getBigDataset())
runs into the same problem if you hit Ctrl-C while 'x' is being evaluated for
the first time. Afterwards, there's no way to retrie
Simon Urbanek wrote:
> Seth,
>
> thanks for the suggestions.
>
> On Oct 18, 2006, at 11:23 AM, Seth Falcon wrote:
>
>> Simon Urbanek <[EMAIL PROTECTED]> writes:
>>> thanks, but this is not what I want (the symbols in the environment
>>> are invisible outside) and it has nothing to do with the
Active bindings are another option (?makeActiveBinding).
It might be worth revisiting how promises are evaluated to see if at
elast a more sensible error message can be achieved, but making sure
any changes do not affect performance will be tricky.
Best,
luke
On Wed, 18 Oct 2006, Duncan Temple
Seth,
thanks for the suggestions.
On Oct 18, 2006, at 11:23 AM, Seth Falcon wrote:
> Simon Urbanek <[EMAIL PROTECTED]> writes:
>> thanks, but this is not what I want (the symbols in the environment
>> are invisible outside) and it has nothing to do with the question I
>> posed: as I was saying i
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi Simon.
One approach is RObjectTables. This provides a way to
customize how variables are accessed/assigned in
an environment and so allows an operation to do something
to compute the value of a variable while still allowing
it to be used as a var
Simon Urbanek <[EMAIL PROTECTED]> writes:
> thanks, but this is not what I want (the symbols in the environment
> are invisible outside) and it has nothing to do with the question I
> posed: as I was saying in the previous e-mail the point is to have
> exported variables in a namespace, but t
Martin,
On Oct 17, 2006, at 11:43 PM, Martin Morgan wrote:
> I believe the technique is to create an environment in the
> namespace, and then to access that through functions:
>
thanks, but this is not what I want (the symbols in the environment
are invisible outside) and it has nothing to d
As is clear from the message you got, promises were originally implemented
to handle lazy evaluation of closure arguments, as essentially transient
objects. There are several aspects of their implementation that are
tailored to that use, one being that they can only be evaluated once (as a
loo
I believe the technique is to create an environment in the namespace,
and then to access that through functions:
sandbox/NAMESPACE
export(getx, setx)
sandbox/R/sandbox.R:
sandbox <- new.env(parent=emptyenv())
getx <- function() sandbox$x
setx <- function(val) sandbox$x <- val
> library(sandbox)
On Oct 17, 2006, at 8:33 PM, Martin Morgan wrote:
>> delayMe <- function() {
> + if (failed) {
> + delayedAssign("x", delayMe(), assign.env=topenv())
> + stop("init me!")
> + } else foo
> + }
>>
>> failed <- TRUE
>> foo <- "is me"
>> delayedAssign("x", delayMe())
>> x
> Er
> delayMe <- function() {
+ if (failed) {
+ delayedAssign("x", delayMe(), assign.env=topenv())
+ stop("init me!")
+ } else foo
+ }
>
> failed <- TRUE
> foo <- "is me"
> delayedAssign("x", delayMe())
> x
Error in delayMe() : init me!
> x
Error in delayMe() : init me!
> faile
Is there a way to raise an error condition when a promise is
evaluated such that is can be evaluated again? Right now strange
things happen when the evaluation fails:
> delayedAssign("x", if (failed) stop("you have to initialize me
first!") else foo)
> foo <- "I'm foo"
> failed<-TRUE
> x
16 matches
Mail list logo