[Rd] changed behaviour of 'get' in 2.8.0: request for unchange

From: <Mark.Bravington_at_csiro.au>
Date: Fri, 24 Oct 2008 14:07:31 +1100

There is an unannounced and non-backwards-compatible change to the behaviour of 'get' in R2.8.0. 'get'ting a missing value now causes an error, whereas hitherto it's just returned a "missing" object. For example, in R2.8.0 this happens:

test> getto <- function( x) get( 'x', sys.frame(1)) test> getto()
Error in get("x", sys.frame(1)) :
  argument "x" is missing, with no default

whereas in R2.7.1 this happens:

test> getto()


i.e. a "missing" object.

While I can see some reason to the change, the error always would have gotten triggered eventually if it actually mattered-- and the new behaviour is inconsistent with other extraction functions:

test> getto2 <- function(x) sys.frame(1)$x test> getto2()


and the same goes for '[['.

'mget' also returns a missing object, rather than tripping an error.

The new 'get' breaks code in packages 'mvbutils' and 'debug'. At least 54 separate functions in those packages use 'get', so there'd be a fair bit of work in checking & changing all these to 'mget'! (Not to mention the entire rest of my code body...)

Is it possible to 'get' the old behaviour back?

Mark Bravington
CSIRO Mathematics & Information Science
CSIRO Marine Lab

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 24 Oct 2008 - 03:13:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 24 Oct 2008 - 11:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive