Skip to content

dim(a <- ...) sets invisible flag erronously (PR#587)

1 message · Brian Ripley

#
This is nothing to do with dim: any function will do this.
It happens because the way invisible is implemented is different in R and S:
in S there is a .Auto.print var in frame 1, and in R there is a global
variable R_visible, so anything during the evaluation that unsets the
flag will ensure that the result is invisible.

I don't see how to avoid this without checking the `depth' in the evaluation
pretty carefully (and R's semantics differ from those of S in that
braced expressions do not generate a frame).

Is this worth fixing?  print(.Last.value) works all the time, and perhaps
you might be persuaded not to write code that uses assignments as arguments?
There seems to be an unused internal function do_visibleflag in print.c.