[Rd] proto and baseenv()

Peter Danenberg pcd at roxygen.org
Fri Feb 26 05:16:17 CET 2010

> Your preference is inconsistent with how the rest of R works and is
> inflexible since everything inherits from Object.

Really? Here are a couple of counterexamples in S3 and S4 objects:

  > z <- 1
  > ## S4
  > setClass('A', representation(a='numeric'))
  [1] "A"
  > a <- new('A', a=z)
  > a at z
  Error: no slot of name "z" for this object of class "A"
  > ## S3
  > a <- structure(list(a=z), class='A')
  > a$z

As far as flexibility is concerned: keep the ability of people to
inherit from the parent environment if they don't mind
namespace-pollution and unpredictability.

I'm merely asking that the default behavior resemble the twenty-three
years of precedent since Ungar's original Self paper.

> Also I think your argument is based partly on repeating the original
> erroneous (relative to the writer's intention) proto code without
> repeating my correction confusing the discussion with simple user
> error.

I acknowledged your correction in an earlier email when I stated that,
"[one has] to choose between eval and parent pollution."

More information about the R-devel mailing list