[Rd] RFC: "loop connections"

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Aug 27 10:23:37 CEST 2005


On Sat, 27 Aug 2005 dhinds at sonic.net wrote:

> Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
>> OK.  I guess you want one of the core people to respond but in the

One has.

>> interim can you explain the terminology "loop"?
>> Also, do you have any prototypical applications in mind?
>
> "loop" is short for "loopback".  A loop or loopback device is one that
> just returns the data sent to it.

That is definitely not what text connections do, and not what I read the 
proposal as being given the analogies to text connections.

> The prototypical applications are the same sort of applications text
> connections are used for: data transformation,

That I think is where Hinds' confusion arises.  As the posting guide asks, 
please do your homework before posting.

Text connections are from the Green Book, where they are described as

- a 'text connection' using S character strings as lines of text input

- Text connections are a convenience to make it easy to use an object
   containing character strings in a computation that expects to read
   from a connection.

They are read-only (or in R but not S, write-only).  Think for them as the 
analogues of the C functions sscanf and sprintf.  Output text connections 
are a particularly convenient way to create text labels -- see for example 
capture.output().

> in this case of raw binary data, rather than formatted text data.  In my 
> case, I needed to interpret a "long raw" column from an Oracle table, 
> that consisted of packed single precision floating point numbers.

That is exactly what read-write anonymous file() connections are designed 
for.  They too come from the Green Book.  (If efficiency were an issue, a 
short purpose-designed C routine would be the answer.  But file 
connections are already much 'smarter' than the proposed implementation of 
loop connections and do allow seeking.)

Another piece of homework might be my article in the very first R 
newsletter.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list