Add an is_closed method to all Handle types
completed by: Fernando Brito
Task Description: Parrot's IO system is broken into a number of PMC types, all of which derive from the abstract type Handle. All of these PMCs should offer a minimal common interface, though each type is free to offer additional methods and functionalities specific to it's type. One method which should be common but is not shared is the is_closed() method.
FileHandle and StringHandle provide this method. Socket does not.
Steps to complete:
- Create a fork of the parrot/parrot repository on github
- Add a new is_closed method to src/pmc/socket.pmc. You can follow the examples in src/pmc/filehandle.pmc and src/pmc/stringhandle.pmc. The function VTABLE_get_bool(INTERP, SELF) will probably return the value you need
- Add a test for the new method in t/pmc/socket.t
- Build Parrot and run all tests (make fulltest) to see that they pass
- Open a pull request on Github to have your changes merged into the parrot repository
Links: http://github.com/parrot/parrot, https://github.com/parrot/parrot/blob/master/src/pmc/socket.pmc