Hey guys,

Because I was curious and had nothing else that I should have been doing
(that second part is a lie), I looked into the namespace code.

I have a working patch that implements importHiddenFrom. It doesn't
currently check whether you then export that symbol (which should not be
allowed) but that would be easy to implement.

Is there any desire from R-core to have add the importHiddenFrom
functionality? If so I can add the export check and submit the patch either
here or on bugzilla. I figure its a long shot but hey, at least I now know
how the namespace stuff works.

I do agree with Peter Meilstrup that poking around at the internals of
someone else's code is often not a good idea, but as others have pointed
out it is done in practice in some fairly high-profile packages, and if its
going to happen it seems like it would be nice to indicate as much in the
NAMESPACE file.

~G


On Thu, Aug 22, 2013 at 5:41 PM, Gray <g...@clhn.co> wrote:

> Peter Meilstrup: (05:01PM on Thu, Aug 22)
>
>  One most often encounters namespace conflicts at the user level, when
>> loading two packages that have no logical connection other than both
>> bearing on your problem of the moment.
>>
>
> Unless I'm mistaken, you can reassign the hidden functions, ie
>
> fna <- joespackage:::usefulfunction
>
> fnb <- janespackage:::usefulfunction
>
> which is a little bit of a pain, but makes the user's code
> unambiguous.  This also works with two colons for explicitly exported
> functions.
>
> --
> Gray Calhoun, Assistant Professor of Economics at Iowa State
> http://gray.clhn.co (web)
>
>
> ______________________________**________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-devel<https://stat.ethz.ch/mailman/listinfo/r-devel>
>



-- 
Gabriel Becker
Graduate Student
Statistics Department
University of California, Davis

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to