Giter VIP home page Giter VIP logo

Comments (4)

mtmorgan avatar mtmorgan commented on May 28, 2024
  • 'isa' is not such a good model here, e.g., R's connections are not character vectors.
  • presumably one would like to transparently manage a collection of files, so File() has length(), [ and names() methods
  • It would be helpful to define the API, e.g., open(), close(), isOpen() and it's relation to the existing connection API.
  • Finalizers seem important
  • a 'registry' of file types seems useful, to map extensions (e.g., '.csv') to appropriate subclasses.

from wishlist-for-r.

lawremi avatar lawremi commented on May 28, 2024

Need to keep the notions of path (File) and stream (connection) distinct. We open() a path to get a stream. There would only be close() and isOpen() methods for the stream.

Also, the path represents a low-level format, but the stream might have richer semantics. For example, an HDF5 file might be represented by an HDF5File object. Lets say someone stored genotypes in the HDF5 file. The open() function might return an object that implements the same API as the VCF class. We could have a dual-dispatch openWithScheme generic that dispatches on the path and some object representing the VCF scheme.

from wishlist-for-r.

mtmorgan avatar mtmorgan commented on May 28, 2024

@lawremi Path versus stream is a useful distinction; sometimes its useful to create a stream without opening it, or to have a stream that exists in a state where it can be opened after being closed. Hence open() on the stream.

from wishlist-for-r.

leeper avatar leeper commented on May 28, 2024

And what potentially intrigues me would be filetype-specific classes that would allow method dispatch. I'm mainly think about this for data import/export (in the context of rio), but I can imagine there might be other contexts, such as calling graphics devices based on file type without the need for jpeg(), png(), etc.

from wishlist-for-r.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.