From sfalcon at fhcrc.org  Thu May 31 19:11:13 2007
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Thu, 31 May 2007 10:11:13 -0700
Subject: [Rd] Possible changes to connections
In-Reply-To: <Pine.LNX.4.64.0705311534280.27499@gannet.stats.ox.ac.uk> (Brian
	Ripley's message of "Thu, 31 May 2007 17:11:42 +0100 (BST)")
References: <Pine.LNX.4.64.0705301726400.11532@gannet.stats.ox.ac.uk>
	<465E7B0B.2080005@altk.com>
	<Pine.LNX.4.64.0705311534280.27499@gannet.stats.ox.ac.uk>
Message-ID: <m24plssytq.fsf@ziti.local>


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
http://bioconductor.org



[Rd] Possible changes to connections
Seth Falcon