GSoC/GCI Archive
Google Code-in 2010 Parrot Foundation and The Perl Foundation

Create embedding API function to get a PMC Class object by name

completed by: Nagato Yuki

mentors: whiteknight

Task Description: Parrot is working on a new embedding API so that libparrot can be used from within other applications. This embedding API contains enough functionality to run existing embedding applications, but not enough to really utilize all the power of libparrot.

Classes in Parrot are objects themselves of type Class. We need an ability to look up a Class by name from the embedding API, similar to the get_class PIR opcode.

Write a new function Parrot_api_pmc_get_class() to get a class object using a lookup key PMC parameter. The new function should follow all conventions of the existing API functions. Ask for help if necessary.

Steps to Compete:

  1. Create a fork of parrot/parrot on Github
  2. Checkout the embed_api2 branch
  3. Create the new function Parrot_api_pmc_get_class() in src/embed/pmc.c. Follow existing examples for how to correctly write an API function
  4. Write a test for the new function in t/src/embed/pmc.c (create that file if it does not exist)
  5. Build parrot and run all tests to verify
  6. Open a pull request on github