From Waclaw.Marcin.Kusnierczyk at idi.ntnu.no  Thu Mar 12 10:08:08 2009
From: Waclaw.Marcin.Kusnierczyk at idi.ntnu.no (Wacek Kusnierczyk)
Date: Thu, 12 Mar 2009 10:08:08 +0100
Subject: [Rd] surprising behaviour of names<-
In-Reply-To: <20090312154616.5b650ce2@berwin-nus1>
References: <49B67CB1.8060005@idi.ntnu.no>	<49B682F9.8050307@biostat.ku.dk>	<49B6E6D9.7010809@idi.ntnu.no>	<96A4BB14-D6EA-44B1-B524-6DB139F3A7F8@r-project.org>	<49B8110A.5060909@idi.ntnu.no>
	<20090312154616.5b650ce2@berwin-nus1>
Message-ID: <49B8D0F8.2080602@idi.ntnu.no>

Berwin A Turlach wrote:
> On Wed, 11 Mar 2009 20:29:14 +0100
> Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk at idi.ntnu.no> wrote:
>
>   
>> Simon Urbanek wrote:
>>     
>>> Wacek,
>>>
>>> Peter gave you a full answer explaining it very well. If you really
>>> want to be able to trace each instance yourself, you have to learn
>>> far more about R internals than you apparently know (and Peter
>>> hinted at that). Internally x=1 an x=c(1) are slightly different in
>>> that the former has NAMED(x) = 2 whereas the latter has NAMED(x) =
>>> 0 which is what causes the difference in behavior as Peter
>>> explained. The reason is that c(1) creates a copy of the 1 (which
>>> is a constant [=unmutable] thus requiring a copy) and the new copy
>>> has no other references and thus can be modified and hence NAMED(x)
>>> = 0.
>>>       
>> simon, thanks for the explanation, it's now as clear as i might
>> expect.
>>
>> now i'm concerned with what you say:  that to understand something
>> visible to the user one needs to "learn far more about R internals
>> than one apparently knows".  your response suggests that to use r
>> without confusion one needs to know the internals, 
>>     
>
> Simon can probably speak for himself, but according to my reading he
> has not suggested anything similar to what you suggest he suggested. :)
>   

so i did not say *he* suggested this.  'your response suggests' does
not, on my reading, imply any intention from simon's side.  but it's you
who is an expert in (a dialect of) english, so i won't argue.


>   
>> and this would be a really bad thing to say.. 
>>     
>
> No problems, since he did not say anything vaguely similar to what you
> suggest he said.
>   

let's not depart from the point.

vQ



[Rd] surprising behaviour of names<-
Wacek Kusnierczyk