From hadley at rice.edu  Wed Mar 21 02:05:50 2012
From: hadley at rice.edu (Hadley Wickham)
Date: Tue, 20 Mar 2012 20:05:50 -0500
Subject: [Rd] Substitute adds id attribute?
In-Reply-To: <4D12E7A7-015E-44BC-8C93-C3199078B144@gmail.com>
References: <CABdHhvEKaDNRDjf-3Rp=b=wvnMO-ZNvk8aLge9-U6K8BkJz4Sg@mail.gmail.com>
	<4D12E7A7-015E-44BC-8C93-C3199078B144@gmail.com>
Message-ID: <CABdHhvFoRb7jaG6SdL54S8NMiJyB9VDKR1Qq3grUynbwyfEctA@mail.gmail.com>

> Well, yes; you can get there more quickly as follows:
>
>> x <- as.name("foo")
>> attr(x,"id") <- 7913
>> x
> foo
> attr(,"id")
> [1] 7913
>> substitute(foo)
> foo
> attr(,"id")
> [1] 7913
>
> I.e. if you ever put an attribute on a symbol, it stays there "forever". The fix is probably to forbid setting attributes on symbols (as we already do for environments and NULL) but I bet that breaks something...

Hmmm, thanks.  No idea what's putting it there, but at least I know
where to start.

Hadley


-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



[Rd] Substitute adds id attribute?
Hadley Wickham