From phgrosjean at sciviews.org  Sun Apr 29 09:30:51 2012
From: phgrosjean at sciviews.org (Philippe Grosjean)
Date: Sun, 29 Apr 2012 09:30:51 +0200
Subject: [Rd] A doubt about substitute() after delayedAssign()
Message-ID: <4F9CEE2B.4080507@sciviews.org>

Hello,

?delayedAssign presents substitute() as a way to look at the expression 
in the promise. However,

msg <- "old"
delayedAssign("x", msg)
msg <- "new!"
x #- new!
substitute(x) #- x (was 'msg' ?)

Here, we just got 'x'... shouldn't we got 'msg'?

Same result when the promise is not evaluated yet:

delayedAssign("x", msg)
substitute(x)

In a function, that works:

foo <- function (x = msg) substitute(x)
foo()

Did I misunderstood something? It seems to me that substitute() does not 
behaves as documented for promises created using delayedAssign().
Best,

Philippe
-- 
..............................................<?}))><........
  ) ) ) ) )
( ( ( ( (    Prof. Philippe Grosjean
  ) ) ) ) )
( ( ( ( (    Numerical Ecology of Aquatic Systems
  ) ) ) ) )   Mons University, Belgium
( ( ( ( (
..............................................................



[Rd] A doubt about substitute() after delayedAssign()
Philippe Grosjean