Giter Site home page Giter Site logo

Reader/Writer/Rewindable interfaces about rbs HOT 4 CLOSED

ruby avatar ruby commented on July 17, 2024
Reader/Writer/Rewindable interfaces

from rbs.

Comments (4)

marcandre avatar marcandre commented on July 17, 2024

I agree, it looks like the sig for IO is incomplete. _Reader, _Writer, _Rewindable should probably be IO::_Read, IO::_Write and IO::_Rewind. _ToIO should be global; if it is much used, maybe io (like string vs String) could be used?

from rbs.

marcandre avatar marcandre commented on July 17, 2024

PS: there is already a _Writeable interface.

from rbs.

HoneyryderChuck avatar HoneyryderChuck commented on July 17, 2024

I would probably not make it rely on the IO names pace, as buffer type structures such as StringIO or Tempfile aren't IOs, however these interfaces can be applied to it.

from rbs.

soutaro avatar soutaro commented on July 17, 2024

Thank you for pointing out the bad types of IO methods. (Would you mind opening a PR to fix them?)

Technically it's unnecessary to define a set of common interfaces beforehand, while I know it would be useful. Because the relationship between interfaces and classes/modules are detected implicitly, without any declaration, having API specific and possibly duplicated interfaces works fine.

So, the steps I assume are:

  1. Define local interfaces for IO methods.
  2. Use the interface in IO method definitions.
  3. Promote it if we find they are useful for other methods too.

from rbs.

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.