[Rd] Possible changes to connections

Seth Falcon sfalcon at fhcrc.org
Thu May 31 19:11:13 CEST 2007

mel writes:
>> There could be/was the same debate in C/C++.
>> That's may be just a matter of education about not forgetting
>> to close previously opened doors !

R is not C/C++.  In general, one does not expect to explicitly handle
memory allocation and release when programming in R.  Treating
connections differently, when there is no longer any technical reason
to do so, is surprising.

Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:
> When I ran some tests I found 7 packages on CRAN that in their tests
> were not closing connections.  Four of those are maintained by R-core
> members.
> Even though none were by me, I think this is too easy to forget to
> do!

I agree that it is easy to forget.  It is especially easy if one
creates so-called anonymous connection references like
readLines(file(path)) -- this anonymous idiom seems nature to me when
coding R and it would be nice to make it work for connections.

+ seth

Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center

More information about the R-devel mailing list