Raku Books / Creating a Compiler in Raku / Functions

Built-in functions

Throughout the book, we were using the say function, that is a perfect example of a built-in function. In this section, we’ll implement three more functions: print, len, and keys. Of course, you may extend the list with your own interesting functions later.

Allow the new keyword in the grammar:

token function-name {
    'say' | 'print' | 'len' | 'keys'
}

Topics in this section

Course navigation

Functions   |   print