Skip to content
Prev 30645 / 63424 Next

Wishlist: fix error in documentation for body<- (PR#13318)

fabian.scheipl at stat.uni-muenchen.de wrote:
It's slightly trickier than that. The value _can_ be a list, but only 
one of length 1. The same actually goes for expressions, but in that 
case there is explicit code to take only the first element. Also, the 
distinction between objects of mode "expression" and unevaluated 
expressions is unclear (here and elsewhere).

 > body(f) <- expression(x,y,z)
 > f
function ()
x
 > body(f) <- list(quote(2+2))
 > f
function ()
2 + 2
 > body(f) <- list(expression(2+2))
 > f
function ()
expression(2 + 2)


BTW: Don't use 'wishlist' on things that are real errors.