From maechler at stat.math.ethz.ch  Sat Jan 14 22:54:55 2012
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Sat, 14 Jan 2012 22:54:55 +0100
Subject: [Rd] A: ImportFrom(B, ...)  -- B: ImportFrom(A, ...)
Message-ID: <20241.63919.31556.448651@stat.math.ethz.ch>

If I have a package A  whose NAMESPACE has
 ImportFrom(B, <B-syms>)) 

and a package B  whose NAMESPACE has
 ImportFrom(A, <A-syms>)

and we can assume that <A-syms> and <B-syms> are disjoint.
The clue would be that I only import relatively little from
one namespace to the other.

I currently get an error

  Error in loadNamespace(imp[[1L]], c(lib.loc, .libPaths())) : 
    cyclic namespace dependency detected when loading ?A?, 
    already loading ?B?, ?A?


but isn't this an unnecessary (and too limiting) restriction?

The use case would be packages Rmpfr and gmp, both for high
precision arithmetic, and it would be considerably more natural
if each could import some facilities from the other, instead of
having an asymmetry  A --> B  (or B --> A).

Martin



[Rd] A: ImportFrom(B, ...) -- B: ImportFrom(A, ...)
Martin Maechler