Re: [R] setting options only inside functions

From: Barry Rowlingson <>
Date: Wed, 27 Apr 2011 22:43:24 +0100

> but it's a little clumsy, because
> with_connection(file("myfile.txt"), {do stuff...})
> isn't very useful because you have no way to reference the connection
> that you're using. Ruby's blocks have arguments which would require
> big changes to R's syntax.  One option would to use pronouns:

 Looking very much like python 'with' statements:

 Implemented via the 'with' statement which can operate on anything that has a __enter__ and an __exit__ method. Very neat.

Barry mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 27 Apr 2011 - 21:51:23 GMT

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 Thu 28 Apr 2011 - 12:50:33 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive