Skip to content

eval and tcltk : target of assignment expands to non-language object

2 messages · vincent guyader, Peter Dalgaard

#
On Sep 24, 2012, at 10:27 , vincent guyader wrote:

            
Not really. You'll get into the same sort of trouble if you try other kinds of complex assignments:
[1] 1
Error in eval(as.name("a"))[[1]] <- 3 : 
  target of assignment expands to non-language object

This is similar to Lumley's fortune("parse"): You may want to rethink the question. Wouldn't 

l <- list(A=tclVar("0"), B=tclVar("0"), B=tclVar("0"))
...
tclvalue(l[[id]]) <- ....

do the job much neater?

However if you insist, I suspect you need to use bquote() and an outer eval(), as in

eval(bquote(.(as.name("a"))[[1]] <- 3))