Re: [Rd] attributes of environments

From: Simon Urbanek <simon.urbanek_at_r-project.org>
Date: Wed 05 Jul 2006 - 18:05:51 GMT

Gabor,

On Jul 5, 2006, at 1:16 PM, Gabor Grothendieck wrote:

>> It really is the way R is designed to work. Whether it is a
>> problem or not is a separate issue. Environments really are
>> references, not values, and they really work differently from the
>> way most other objects work.
>
> OK. Its not a bug but as we discuss this it seems to me that its
> current operation is undesirable

We discuss it only because *you* think it's undesirable...

> since environments don't seem to fit into the scheme that other
> objects do yet different design/implement would allow this to occur.
>

Environments are different *on purpose*, what environments do cannot be achieved using any other 'standard' object. And it's exactly environment's behavior on assign that makes it useful, so what you are proposing is basically making it into a list (so that it gets copied on assign), which makes no sense. What you really want is something other than an environment, but you insist on using an environment - it's like insisting on using a screwdriver on a nail - it's not the screwdriver's fault that it doesn't work ...

.. and since you pounding on OO - environments are the closest you can get to an object semantics as implemented in the most popular OO languages, so I wonder why you aren't arguing to make all objects into references ;).

Cheers,
Simon



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Jul 06 04:15:11 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 05 Jul 2006 - 20:35:07 GMT.

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