From ggrothendieck at gmail.com  Thu Sep 20 01:29:49 2007
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Wed, 19 Sep 2007 19:29:49 -0400
Subject: [Rd] delayedAssign
In-Reply-To: <971536df0709191230p3a62d94g1dcf8f978dad6305@mail.gmail.com>
References: <971536df0709191230p3a62d94g1dcf8f978dad6305@mail.gmail.com>
Message-ID: <971536df0709191629ld369552p13b5973ee8d29c6b@mail.gmail.com>

Also note that earlier in the same example we have:

> msg <- "old"
> delayedAssign("x", msg)
> msg <- "new!"
> x #- new!
[1] "new!"
> substitute(x) #- msg
x
> R.version.string # Vista
[1] "R version 2.6.0 alpha (2007-09-06 r42791)"

That is substitute(x) gives x, not msg.

On 9/19/07, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
> The last two lines of example(delayedAssign) give this:
>
> > e <- (function(x, y = 1, z) environment())(1+2, "y", {cat(" HO! "); pi+2})
> > (le <- as.list(e)) # evaluates the promises
> $x
> <promise: 0x032b31f8>
> $y
> <promise: 0x032b3230>
> $z
> <promise: 0x032b3268>
>
> which contrary to the comment appears unevaluated.  Is the comment
> wrong or is it supposed to return an evaluated result but doesn't?
>
> > R.version.string # Vista
> [1] "R version 2.6.0 alpha (2007-09-06 r42791)"
>



[Rd] delayedAssign
Gabor Grothendieck