From hadley at rice.edu  Tue Nov 16 01:56:17 2010
From: hadley at rice.edu (Hadley Wickham)
Date: Mon, 15 Nov 2010 18:56:17 -0600
Subject: [Rd] Trying to understand the search path and namespaces
In-Reply-To: <AANLkTikPE5acZ6CKJeoq9RpphUJffr4W8Lm_8c7O7i08@mail.gmail.com>
References: <AANLkTin090pRti8dXknLKtpFmUmmvRsAz6a0V2mx5iOM@mail.gmail.com>
	<AANLkTi=3K0T7qzQnRU-Q8h3RVTDS+UQ5CmcOs4xZJYfD@mail.gmail.com>
	<AANLkTikPE5acZ6CKJeoq9RpphUJffr4W8Lm_8c7O7i08@mail.gmail.com>
Message-ID: <AANLkTimckaNaUb6SjY=njVZuRSa1iJ+4entWVA2ghBxD@mail.gmail.com>

> Well, that's what I thought too. ?But:
>
> parents <- function(x) {
> ?if (identical(x, emptyenv())) return()
> ?c(environmentName(x), parents(parent.env(x)))
> }
>> parents(as.environment("package:devtools"))
> [1] "package:devtools" "package:methods" ?"Autoloads" ? ? ? ?"base"
>
> And package:testthat isn't listed there. ?(But Autoloads is suggestive...)

Hmmm, autoloads isn't it:

> parent.env(parent.env(as.environment("package:devtools")))
<environment: 0x100951f88>
attr(,"name")
[1] "Autoloads"
> ls(parent.env(parent.env(as.environment("package:devtools"))))
character(0)

Hadley

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



[Rd] Trying to understand the search path and namespaces
Hadley Wickham