Skip to content
Prev 350945 / 398502 Next

Deparse substitute assign with list elements

txt <- paste( nm, '<-', tmp, sep='' )
        eval( parse(text=txt), parent.frame() )

        in `foo()` will do the trick.

Yuck.

If you use that sort of syntax your code becomes hard to understand and
you risk changing variables that users do not want changed.  When the
use uses something like bar(x)<-newValue she knows that 'bar' is going to
change.

Your new code will also fail if you try something like foo(b+10).


Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, May 15, 2015 at 1:50 AM, <soeren.vogel at posteo.ch> wrote: