Skip to content
Prev 10316 / 398503 Next

Call by reference: Was: Object orientation?

"Henrik Bengtsson" <henrikb at braju.com> writes:
.....
It may work, but I wouldn't think it is documented to do so and could
easily get blown away by an internal change (and *I'm* not going to put
checks in to ensure that it keeps working)! 

If you really must do this kind of thing, try coding along the lines
of

set<-function(object,value)
	eval.parent(substitute(object$value<-value))

Or use assign(), or even "<<-", at least that is well-defined. It can't
get nastier than .Alias.