From saikat at stat.wisc.edu  Mon Aug 11 13:23:10 2003
From: saikat at stat.wisc.edu (Saikat DebRoy)
Date: Mon Aug 11 18:23:09 2003
Subject: [Rd] An inconsistency with promise in attributes
Message-ID: <19416FD2-CC18-11D7-95DA-0003931A3C9E@stat.wisc.edu>

When an attribute is a delayed expression sometimes it is not forced 
when it is extracted.

 > x <- list()
 > attr(x, "p") <- delay(1)
 > x
list()
attr(,"p")
<promise: 0x11e4bb8>
 > val <- attr(x, "p")
 > val
[1] 1
 > attr(x, "p")
<promise: 0x11e4bb8>

I am not quite sure whether the above is a bug or not but I think the 
following is a bug - a promise is supposed to give its value once 
evaluated!

 > eval(attr(x, "p"))
<promise: 0x11e4bb8>


[Rd] An inconsistency with promise in attributes
Saikat DebRoy