From Waclaw.Marcin.Kusnierczyk at idi.ntnu.no  Thu Mar 12 10:21:18 2009
From: Waclaw.Marcin.Kusnierczyk at idi.ntnu.no (Wacek Kusnierczyk)
Date: Thu, 12 Mar 2009 10:21:18 +0100
Subject: [Rd] surprising behaviour of names<-
In-Reply-To: <49B8D060.8090206@idi.ntnu.no>
References: <49B67CB1.8060005@idi.ntnu.no>	<49B682F9.8050307@biostat.ku.dk>	<49B6E6D9.7010809@idi.ntnu.no>	<96A4BB14-D6EA-44B1-B524-6DB139F3A7F8@r-project.org>	<8CCAAAD3-919F-462F-A616-F4FDDB46D975@r-project.org>	<49B81186.4070107@idi.ntnu.no>	<20090312154008.56706f38@berwin-nus1>
	<49B8D060.8090206@idi.ntnu.no>
Message-ID: <49B8D40E.5000103@idi.ntnu.no>

Wacek Kusnierczyk wrote:
>
> is precisely why i'd think that the prefix 'names<-' should never do
> destructive modifications, because that's what x = 'names<-'(x, 'foo'),
> and thus also names(x) = 'foo', is for.
>
>   

to make the point differently, i'd expect the following two to be
equivalent:

    x = c(1); 'names<-'(x, 'foo'); names(x)
    # "foo"

    x = c(1); do.call('names<-', list(x, 'foo')); names(x)
    # NULL

but they're obviously not.  and of course, just that i'd expect it is
not a strong argument.

vQ



[Rd] surprising behaviour of names<-
Wacek Kusnierczyk