From ggrothendieck at gmail.com  Wed Jul  5 21:47:01 2006
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Wed, 5 Jul 2006 15:47:01 -0400
Subject: [Rd] attributes of environments
In-Reply-To: <44AC110B.90306@stats.uwo.ca>
References: <971536df0607042012h43eb1581n418e9cddfe3a51bb@mail.gmail.com>
	<Pine.LNX.4.64.0607050857440.32591@homer22.u.washington.edu>
	<971536df0607050910w2a35e6ecxef5dec5c41a781e3@mail.gmail.com>
	<Pine.LNX.4.64.0607050911380.32591@homer22.u.washington.edu>
	<971536df0607050939r11dbdb93g6186550477e78d92@mail.gmail.com>
	<Pine.LNX.4.64.0607050947290.32591@homer22.u.washington.edu>
	<971536df0607051016m3ad69f53j3c97ccebf759781d@mail.gmail.com>
	<5062E054-F56C-42AA-A446-BC53628DC189@r-project.org>
	<971536df0607051123p6f0eaf6chc9e50cfc72b0fe51@mail.gmail.com>
	<44AC110B.90306@stats.uwo.ca>
Message-ID: <971536df0607051247p7f30412bs45c6cf81dfc16949@mail.gmail.com>

On 7/5/06, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
> On 7/5/2006 2:23 PM, Gabor Grothendieck wrote:
> > On 7/5/06, Simon Urbanek <simon.urbanek at r-project.org> wrote:
> >> 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...
>
> Gabor, I think Simon misread what you wrote above (taking "as we discuss
> this" to mean "because we discuss this", rather than "during our
> discussion of this"), and you misread his reply.  This doesn't look to
> me like an ad hominem.
>
> >> > 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
> >>
> >>
> >
> > I don't think ad hominem arguments and unsupported statements that
> > things "make no sense" or analogies to screwdrivers have any relevance
> > to this discussion.
>
> You have ignored my explanation of why things are the way they are.
> Simon's statement is not unsupported in the context of the complete
> discussion.
>
>  I think by this time I have shown that subclassing of
> > environments does not work yet it could if it were designed differently
> > and furthermore there are significant problems with the workarounds.
>
> I don't think you've shown that subclassing of environments doesn't
> work.  You have an example that shows that shows that R implements
> Henrik's "Case 2" rather than his "Case 1", but as Thomas and I said,
> that really has nothing to do with subclassing.
>
> Subclassing is about defining a new class, not about copying objects.
> You can (and did!) define a new class which inherits from the
> environment class.

But by subclassing in the way allowed one comes up with something that
is not useful.

That is why tcltk and Henrik's package wrap environments in lists and define
a completely different class but by doing that they are not able to take
advantage of inheritance.



[Rd] attributes of environments
Gabor Grothendieck