Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: enum for programming languages

  • Create an enum representing "all" the programming languages. (py for Python, rs for Rust)
  • Add a constructor to return the enum based on the file extension.
  • Remember, Perl uses both pl and pm as extensions.
  • Write tests that will check some of the cases.