Skip to content
Prev 2588 / 63421 Next

matplot(... panel.first=..) fails <==> dealing with "..." (PR#267)

maechler@stat.math.ethz.ch writes:
...
That's a result of lazy evaluation. plot.default is really playing
with fire, the way it is currently written. list(...) will force
evaluation of the promises which in turn causes grid() to be called
too early. I don't think it is desirable to change this behavior
(well, Robert wants us to consider eager evaluation, but that would
cause the construction to stop working in all cases!)
Neither of the above, because the object is to access "..." without forcing
evaluation of its contents. One can do things like
function (...) 
{
    n <- names(match.call(expand.dots = F)[["..."]])
    plot.default(...)
}

Or, one can modify plot.default to take panel.first as an
*unevaluated* expression (mode "call" or "expression"), and do an
explicit eval(panel.first). But then you'd have to do 

p2(1:10, panel.first = quote(grid(10,10))) # or expression( )