I believe it would be better if the internal code forced the promise
at this point.  I'll have a look; there may be a few other similar
instances worth looking at.

luke

On Tue, 22 May 2012, Yihui Xie wrote:

Thanks! That is exactly what I did
(https://github.com/yihui/knitr/blob/master/R/cache.R#L44) but I was
wondering if .Random.seed could be better recognized when it is lazy
loaded.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Tue, May 22, 2012 at 8:08 PM, Duncan Murdoch
<murdoch.dun...@gmail.com> wrote:

You can remove it by a simple assignment:

.Random.seed <- .Random.seed

will do it.  (The reason is that it doesn't copy the object blindly, it
evaluates the RHS to get 1L, and it's a regular assignment, so that gets put
into the LHS.)

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to