Re: [Rd] Recent and upcoming changes to R-devel

From: Kasper Daniel Hansen <kasperdanielhansen_at_gmail.com>
Date: Wed, 06 Jul 2011 10:06:37 -0400

On Wed, Jul 6, 2011 at 9:42 AM, Duncan Murdoch <murdoch.duncan_at_gmail.com> wrote:
> On 11-07-06 9:25 AM, Kasper Daniel Hansen wrote:
>>
>> On Mon, Jul 4, 2011 at 8:08 AM, Prof Brian Ripley<ripley_at_stats.ox.ac.uk>
>>  wrote:
>>>
>>> In the near future all packages will have a name space.  If the sources
>>> do
>>> not contain one, a default NAMESPACE file will be added. This again will
>>> simplify the descriptions and also a lot of internal code.  Maintainers
>>> of
>>> packages without name spaces (currently 42% of CRAN) are encouraged to
>>> add
>>> one themselves.
>>
>> This is great.  However, it would also be great if a user could
>> disable this for a given package at install time, for example with a
>> command line argument to R CMD INSTALL.  Use case: in the early stages
>> of package development I find it incredible useful to not have a
>> NAMESPACE.  This is of course before I release it to anyone else;
>> purely for development.
>>
>> My guess is that this has already been anticipated, but in case not, I
>> wanted to raise the issue.
>
> I think the idea is to completely remove support for the bad search order
> you get when you don't have a namespace.  That search order is a mixed
> blessing in debugging:  it makes it easy to replace functions with new
> versions, but it also makes it very easy to execute the wrong code if you
> happen to have something sitting in the global environment that has a
> conflicting name.
>
> It seems like something a front end could do to make assignInNamespace
> easier to use to make working with namespaces easier.

Indeed I find this change to be a very welcome addition to R that will make the life easier for many of us; especially when you are using someone else's package.

My use case is also not debugging my own code when it is a at a semi-mature level. I am addressing the very early stages of developing a new package. In my workflow (which may differ from other people's; but I do think a substantial number would agree with me), the early stages of development usually entails bringing order to a number of R scripts; figuring out the structure of the basic objects as well as the arguments for the important functions/methods. In this early stage, almost any evaluation I do at the R prompt is followed by refactoring some part of the code (and then sourcing it into R).

Once the code is semi-matured (after the first couple of weeks), I don't think I would mind a NAMESPACE at all, but I believe I would find it very frustrating during the very early development stage (which I am going through right now for one package and which I went through a month ago for another package).

Kasper



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 06 Jul 2011 - 14:12:06 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 06 Jul 2011 - 14:30:06 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.

list of date sections of archive