Re: [Rd] NAMESPACE

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Fri 22 Sep 2006 - 18:29:53 GMT

On 9/22/2006 2:07 PM, Dominick Samperi wrote:
> Hello,
>
> I just tried to use NAMESPACE to prevent name conflicts between
> packages and it appears that once a name is exported it will clash
> with the same name if it is exported from another package, in
> particular, if that other package does not use NAMESPACE.
>
> Is there a way to "export" a name so that the current package
> user can see it, but other packages cannot see it? My working
> assumption is that this is not possible, so I use a prefix like
> the package name to keep function names "local."

I don't think so. Packages without namespaces start their search for names in the global environment, i.e. they see what a user sees. This makes them very fragile, and there's not much you can do about that, other than encouraging the author to bite the bullet and install a namespace.

Duncan Murdoch



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat Sep 23 04:32:06 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 22 Sep 2006 - 23:30:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.