On Fri, May 30, 2014 at 9:17 PM, Gábor Csárdi <csardi.ga...@gmail.com>
wrote:

> On Fri, May 30, 2014 at 9:08 PM, Hadley Wickham <h.wick...@gmail.com>
> wrote:
>
>> > Finally, now that the use of a NAMESPACE became mandatory (well, this
>> > happened a few years ago), advocating systematic use of foo::whatever()
>> > without explicitly importing the function sounds a little bit like an
>> > heroic act of resistance ;-)
>>
>> I don't think that's at all true - for most other programming
>> languages, the preferred style is to explicitly refer to functions,
>> including their namespace/package etc.
>>
>
> I think with R the issue of having functions with the same name (but
> different semantics) imported from different packages does not come up too
> often. IMHO the reason for this is (partly) historical. In the past there
> were no namespaces, at least they were not mandatory, and packages were
> loaded and attached as a whole, so people were defensive and used very
> specific function names to avoid name clashes.
>
> I chose graph.density() over density() and chose graph.adjlist() over
> adjlist(), etc. Last week I am chose diff() over git_diff(), and I guess I
> am not the only one with this tendency. It is just a matter of time to have
> a bunch of packages with a diff() function, and then it will matter where
> diff() is coming from.
>

Btw. this said, personally I still prefer importFrom(pkg, diff) and then
diff() to pkg::diff(), most of the time.

Gabor

[...]

        [[alternative HTML version deleted]]

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

Reply via email to