Write a new API function to get a Method from a PMC
completed by: Kristaba
Task Description: Parrot is developing a new embedding API in the embed_api2 branch. This work is going well and we expect to merge it soon. The API contains enough functions to make basic embedding applications work, but it does not really do enough for the needs of our embedders.
In Parrot, Methods and Subroutines are all objects themselves. In fact, they are "Sub" PMCs. To invoke a method on an object, we first look for the method PMC, then invoke the method PMC passing the invocant and arguments. The embedding API has the ability to invoke a Sub PMC, but does not yet have the ability to search for a Method PMC in an object.
Create a new API function to search for a method in an object. Write tests to verify that you can find and invoke a method using this new API
Steps to Compete:
- Create a fork of parrot/parrot on Github
- checkout the embed_api2 branch
- Add a new function Parrot_api_pmc_find_method() to the file src/embed/pmc.c, following existing conventions of the API. Ask for help or clarification if necessary
- Write a test for your new function in t/src/embed/pmc.t. Create that file if necessary. Feel free to copy from existing examples in that directory or elsewhere
- Build Parrot and run all tests to verify behavior
- Open a pull request on Github to have your changes merged.